Regular expression for only allow numbers and must end with '#' sign
14,800
Solution 1
This can be accomplished by using:
/^[0-9]+#$/
Solution 2
Use $ to mean at the end of the string. Try this:
/^[0-9]+#$/
Further explanation:
^ Start of string [0-9] Only characters in 0-9 + At least one # Literal # $ End of string
Solution 3
This is what you are looking for:
/^\d+#$/
Author by
Kashiftufail
Updated on June 15, 2022Comments
-
Kashiftufail almost 2 years
I want a regular expression that validate a string that allow only numbers and this string must end with a numeral symbol
#
.Like:
353645#