I am new to regular expressions. I am looking for String which can have only characters 'SALT' which is prefixed by + or – sign.
I am using [(SALT){1}\+-]{8} which is partially working. Not completely.
Total characters 8
Acceptable values
+S+A+L+T
+S-A-L+T
+T+L+A+S
These are the following values which are not acceptable.
No repeat of characters except +,- as a prefix only.
i.e
S+L+S+S ( Character is repeated in this )
S+++++
-------S
S-+S-+S
I would appreciate if anyone help me in this regard.
Thanks
[(SALT)]is a character class; it matches a single character which can be a literal(orSorAor ...