Let's say I have some strings :
some50
some51/x
some52/y
some53/z
some510
some511/x
some512/y
some513/z
I want to test if my string are in the form some
+ a number + anything.
I use for this requirement the pattern : ^some\d+
, which is returning me all matches.
Now I have a requirement to exclude some of the numbers. For example, I have to exclude 51 and 52 from the matches. What is the correct expression ?
I've tried (more a guess than a try I admit):
^some(\d+|(?!(51|52)))
^some((\d+)(?!(51|52)))
^some(\d+)^(?!(51|52)))
^some(\d+)(?!(51|52)))
but none of the them are returning the expected result, which is :
some50
some53/z
some510
some511/x
some512/y
some513/z
PS: don't know if it matters, but the regex is used within a PowerShell script.
[Edit] Extended the questions to show that 51x should not be excluded