efj:Grand works a treat, thanks prometheuzz.
...
Good to hear that!
efj: 1) ^general00 $
-show the start and end of the word to match (add this as best practice/effeciency?) prefix of general00
Not the start and end of a word: but rather the start and end of the input string (although that is what you meant, is my guess). I added those meta characters (^ and $) because in many regex-flavors, if a part of the input string matches, the value 'true' (or something similar) is returned. That would mean that the string "general002500", or "ABCgeneral0025" would also match since the underlined part matches. So, that's why I anchored the start and end of the string.
efj: 2) (?!20)
-match where general is not followed by 20 i.e don't match 20.
Where "general00" is not followed by "20", although, again, I suspect a typo on your side and that you really meant to type "general00". So, yes, that's true.
efj: 3) (?: )
-create a non capturing group (add this as best practice/effeciency rather than a capturing group)
True. Just a habit on my side: note that the "readability" of a regex is also important. So, if you're not comfortable with them (not true in your case, I see), or are working in a group of developers, you can of course leave them out. Especially when the regex-patterns and input strings are small (then little difference can be made in that case).
efj: 4) [0-2]\d
-match on 0 or 2 followed by any single digit
5) |30
-or the value 30.
Yes and yes.
efj:
No problem, glad to be of help. It's always nice to be able to help someone who is able to put his/her problem into a meaningful, coherent question and tries to figure things out by themselves instead of posting an immediate follow up question!
Kind regards,
Bart.