negation « Operation « Java Regex Q&A

Home
Java Regex Q&A
1.Development
2.find
3.group
4.Match
5.matcher
6.number
7.Operation
8.parse
9.Pattern
10.replace
11.validation
12.word
Java Regex Q&A » Operation » negation 

1. Display unmatched strings, regex negation    stackoverflow.com

Is there any way where I can display all characters and strings except a certain set of words or range of numbers, using Java? For example: Regex:

^(if|else),[0-9] 
Input String:
if x <= 7
Output: Unrecognized ...

2. String negation in regular expression    coderanch.com

Hello, I was wondering how to negate a string (!!! Not a single character). For example I need to write an expression that evaluates to true if the string does NOT contain for example 'foo'. There is not something like !(foo). Any ideas, Greetz, Ivo Willemsen [ December 26, 2006: Message edited by: Bear Bibeault ]

4. RegEx String Negation    forums.oracle.com

Come off it. Why are you being so defensive and pedantic? I was expressing the view that it could be done in one stage rather than in two. If you think that your procedure outlined in reply #1 results in better code than I posted in reply #6 then post something to illustrate this.

5. Regex negation    forums.oracle.com

I actually like parsers much better than regex, but I am concerned with optimization(yes, I'm one of those kinds of programmers). I hesitate to tokenize the data and then run through it by hand, unless it is faster. Still, if I don't get the answers I need here, I might just do that. Before that happens, hopefully someone will come along ...

6. negation of a phrase in regular expressions    forums.oracle.com

7. regex problem negation    forums.oracle.com

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.