I need a RegEx to determine if a “word” meets a pattern
the Pattern is
- Must start with $, # ! or %
- which must be followed by a letter
- which then can optionally be followed by letters or numbers
this is what I have … which seems to work
let FILE_REGEX = "^[$#!%][A-Za-z][A-Za-z0-9]*?$"
first off… is this in fact correct?
and second. how can it be modifed so that it can start with any number of “$”
- $$$X is valid
- %%X is NOT
ie. only the $ can have more than 1 instance