Hi Guru’s,
I need a regular expression in Java for the following cases should satisfy.
Token match is my requirement. Token should at least surrounded by a space. If there is no space before/after/both then it should return false.
My Token is RAGAV, so following condition should satisify
Case -1 : RAGAV --> Matcher should return–> True
Case -2 : ABCRAGAVXYZ --> Matcher should return–> False
Case -3 : ABC RAGAV --> Matcher should return–> True
Case -4 : ABCRAGAV XYZ --> Matcher should return–> True
Case -5: ABC RAGAV XYZ --> Matcher should return–> True
Here i gave an example. Need Regex to satisfy all above condition generic cases. Token can be anything in the Database.
Regards,
Ragav