I'm not an expert on regular expressions so I thought I'd throw this question out. I'm thinking regular expressions can help make my tests more robust (testing generated EJB QL statements for correct generation).
For example:
select u.firstName, u.lastName from Users u where u.age > 50
What regex do I use to split it into the following?
- "u.firstName, u.lastName"
- "Users u"
- "u.age > 50"
regardless of the case of the keywords (i.e. SELECT, Select, select, ...) and regardless of the possible spaces before and after the keywords? Of course it would be even better to split it further, but if I can split parts as above example, I can improve my tests.
Thanks in advance for any pointers and help.