I can write a regular expression that will only match strings that are
NOT the word apple:
^([^a].*|a[^p].*|ap[^p].*|app[^l].*|apple.+)$
But is there a neater way, and how would I do it to match strings that
are NOT the word apple OR banana? Then what would be needed to match
only strings that do not CONTAIN the word "apple" or "banana" or
"cherry"?
I'd love it if the following worked:
[^(apple)(banana)(cherry)]*$
But it appears the parantheses are ignored, as
[^(apple)(banana)(cherry)]*$
simply matches any string that consists entire of the characters
a,b,c,e,h,l,n,r,p & y.
how do i match everything except the word apple in the following sentence
this apple ate an AppLe, APPLE, apple, Apple, applE
(everything except 'apple' should be matched))
NOT the word apple:
^([^a].*|a[^p].*|ap[^p].*|app[^l].*|apple.+)$
But is there a neater way, and how would I do it to match strings that
are NOT the word apple OR banana? Then what would be needed to match
only strings that do not CONTAIN the word "apple" or "banana" or
"cherry"?
I'd love it if the following worked:
[^(apple)(banana)(cherry)]*$
But it appears the parantheses are ignored, as
[^(apple)(banana)(cherry)]*$
simply matches any string that consists entire of the characters
a,b,c,e,h,l,n,r,p & y.
how do i match everything except the word apple in the following sentence
this apple ate an AppLe, APPLE, apple, Apple, applE
(everything except 'apple' should be matched))