I have a regex to find if string have like this -> “#3232” substring.
/(#|\/)\d+$/
I want to find that if string doesn’t have any other character except /(#|\/)\d+$/.
Here is an example
string s = "bla bla bla #3242 bla"; //no it has some extra characters
//except #3242
string s = "#3126"; // yes it's the right word, It doesn't
// have any characters except #3126
How about anchoring the regex to the start and end of the string: