Answers for "regex only one occurrence of character"

0

regex only one occurrence of character

You can do this

/^[^-]+-[^-]+$/
^ depicts the start of the string

$ depicts the end of the string

[^-]+ matches 1 to many characters except -
Posted by: Guest on March-04-2021

Code answers related to "regex only one occurrence of character"

Browse Popular Code Answers by Language