(e-mail address removed) wrote:
: That will work for perl, but I'm actually using Java for my regex.
Are you sure you handled the string escapes correctly?
with java you have to do \\ for \ in regexp and \" for ".
That makes sometimes simple things complicate.
In perl you can just:
print $1 if( /"[^"]*"/ );
Look at the java regexp syntax, do you use some feature it
does not support, it does not have all the features of java.
try:
"(a[b-z])|(b(a|[c-z]))|(c([a-b]|[d-z]))|(e([a-d]|[f-z])) ...
That should work ;-)
You are using:
(?!X) X, via zero-width negative lookahead
This seems to be supported by java,
I have never used it either with perl nor java, so
I cannot comment.
BTW:
Are you using this pattern
http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html
or some older, because there used to be 3rd party regexp libs 4 java
before JDK 1.4
And last but not least:
How bout doing some java code to do it...