Hi I need a Regex that can actually get any letter that is inserted after "-" dash e.g i have a string that says
"UpTown-R" , "Category-C"
What I get in return is "R" , "C".
See Question&Answers more detail:osHi I need a Regex that can actually get any letter that is inserted after "-" dash e.g i have a string that says
"UpTown-R" , "Category-C"
What I get in return is "R" , "C".
See Question&Answers more detail:osIf is always the last part of the string, you can do this
/[^-]+$/
see it here on Regexr
[^-]
is a character class that matches everything that is not a dash
+
quantifier means one or more of the preceding element
$
anchor for the end of the string