I’m having an issue with my regex matching a string which I do not want it to match. I can’t seem to find the correct syntax for the expression. Here is an example:
String:
ABC098765432109,~~Z 10Y-123~This is a test^ABC-DE-_F
Regex:
m/^.\*?,\d\*[\~]{2}\w\s\d\*\w-\d\*~.\*?\^.\*?-.\*?-.\*?_\w$/
The ,\d* portion I thought would eliminate the string which has no digits directly after the comma.
Any suggestions on getting this to work?
"*"means “zero or more”. You may want"+", which means “one or more”. So,does not match