I’m trying to look at a string and reject anything that has seq= or app= in the string. Where it gets tricky is I need elements with q=something or p=something.
The seq= part of the string is always preceded an & and app= is always preceded by a ?
I have absolutely no idea where to start. I’ve been using http://www.rubular.com/ to try and figure it out but to no avail.
Any help would be hugely appreciated.
Based on your question, I believe you could just reject any strings that match the following expression:
This will match any string that contains a
?or&followed by eitherapp=orseq=. The?:inside the parentheses just tells the regular expression not to bother to capture matching groups as sub-matches. They’re not really necessary, but what the heck.Here’s a Rubular link with some samples.