I still hate Regex

guess my mind is not capable of wrapping itself around RegEx patterns :frowning:
No matter how much documentation I read, I still end up shooting in the dark and missing 90% of the time.

I need a pattern that matches

  • Must begin with a LETTER [A-Z] upper or lower case
  • MAY be followed by any number of [A-Z,a-z,0-9]
  • MAY optionally end with $, #, ! or %

This is what I came up with… and it doesn’t work of course

^[A-Za-z][A-Za-z0-9]*[$#!%]?$

“A”, “AA”, “A1”,“A12A321”, “A134#” etc would all be legal matches

I don’t see anything wrong with that pattern, but I’m not in a position to test it.

Well I’ll be… it DOES seem to work… for some reason I though the $#!# had to be handled special
so I “assumed” it would not work

Thanks Kem :slight_smile:

You did handle then specially, by putting them in a character class (square brackets).

Glad it worked out. See, not so tough. :slight_smile: