Jack Bush wrote:I can use multiple Java string matches and combine them with booleans to achieve the same objectives but would like to find out how the regexes work on their own.
Then my suggestion would be to find a good tutorial. I'm a reasonably advanced regex user (old Unix sysadmin), and even I would tackle this in stages:
1. Get your "words".
2. Run much simpler regexes against each word.
The trouble with trying to do it all at once is that you're likely to end up with a huge (and extremely arcane) expression that has to be documented
for the next poor soul who has to look at your code - which may be you in a few years time when you've forgotten what you were trying to do.
BTW - Could you possibly reduce the line length on your posts? It's a bit of a pain having to scroll backwards and forwards constantly.
Joined: Oct 20, 2006
Thanks for this valuable advice Winston,
I need to strike the balance between keeping the codes simple for ease of maintenance while trying
to exploit the power of regex.
subject: How to regexes with negations / exceptions