I'm trying to create a regular expression and having a ton of problems understanding how to get Negation to work correctly the way I need it to.
I'm trying to do this using regular expressions in Javascript, but the format should be the same
Here's a couple of samples of input:
1) openview
2) openview&lines=3
3) openview&count=30
4) openview&count=30&lines=3
5) openview&lines=3&count=30
I want to find only expressions which contain "openview", but do NOT contain "count"
I've tried
/openview[.]*^(count).*/i
/openview[.]*[^(count)].*/i
/openview[.]*[^(count)]*/i
and a few other strange obscure mixes and matches, but none of the them seem to work.
Can someone show me what the correct RegExp would be, and explain why, if it isn't apparent?
Thanks
I'm trying to do this using regular expressions in Javascript, but the format should be the same
Here's a couple of samples of input:
1) openview
2) openview&lines=3
3) openview&count=30
4) openview&count=30&lines=3
5) openview&lines=3&count=30
I want to find only expressions which contain "openview", but do NOT contain "count"
I've tried
/openview[.]*^(count).*/i
/openview[.]*[^(count)].*/i
/openview[.]*[^(count)]*/i
and a few other strange obscure mixes and matches, but none of the them seem to work.
Can someone show me what the correct RegExp would be, and explain why, if it isn't apparent?
Thanks