Re: NOT operator
"Daniel F. Savarese" <[email protected]> Sun, 21 Sep 2003 12:15:00 -0400
| Newsgroups | gmane.comp.jakarta.oro.user |
|---|---|
| Message-ID | <[email protected]> |
In message <[email protected]>, [email protected] writes: >I tried ORO 2.0.7 in AWK-mode with a >regular exp. which contains not operator. ... >How can I check if pattern contains 1 >but NOT 2? (I tried "!" and "~" and "^" >without success! :( ) There are many variations of awk out there, so I suppose some may contain such a regular expression metacharacter, but as far as I know traditional awk does not. If you want to perform boolean operations, you have to perform multiple matches. For example, matcher.contains(input, pattern1) && !matcher.contains(input, pattern2) Sometimes you can get clever and a pattern like "^[^2]*1[^2]*$" will serve your purpose. daniel