>> I hadn't realized it returns an array, so had forgotten '[]' in var
>> name... it worked w/o a regular expression,
[quoted text clipped - 3 lines]
>> although it says in docs this method takes a regular exp as argument..
>> http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#split(java.lang.String)
IIRC, & is only significant in replacement strings. You can use
Pattern.quote to quote literals in regexs, and Matcher.quoteReplacement
for replacement strings (from 1.5).
http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html#quote(java.
lang.String)
http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Matcher.html#quoteReplac
ement(java.lang.String)
> well, ACTUALLY.... it is and it isn't working...
> in my Tomcat locally it works fine, but when I upload to server I get
[quoted text clipped - 7 lines]
> only diff. -- that I can see -- being Tomcat versions (5.0.27 on my
> machine and -- judging by what it says here -- 3.2.2 on server..)
That's a really backward version of Tomcat. Presumably it has unpatched
known security flaws.
Looks as if it is running on JRE 1.3 (or earlier), which doesn't have
String.split or regexs.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
Roedy Green - 12 Sep 2005 21:14 GMT
>IIRC, & is only significant in replacement strings. You can use
>Pattern.quote to quote literals in regexs, and Matcher.quoteReplacement
>for replacement strings (from 1.5).
The rules for when you need the quoting can be a bit boggling, since
they differ for search and replacement, and for the various different
regex engines you use. I use three different ones in a day.
I have two ways of sorting this out.
1. Quoter amanuensis that inserts \ quotes where needed to get he
literal meaning. See http://mindprod.com/applets/quoter.html
2. the happy rule that is ok to quote even when you don't need it. So
most of the time I just quote any awkward looking character.
That protects me from some future regex where new magic chars are
introduced.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.