Java's Regexp Sucks!!!

K

kramer31

What is this CDATA crap? Has Sun never heard of escape characters.

Whenever I have to use Java's regular expression engine, it takes me
hours to do what I could do in minutes with Perl.

WTF?

Why didn't Sun just rip off Perl's regexp syntax and OOify it or make
regexes primitives?

Fancy-schmancy java crap.

On the other hand, I do like the OO nature of Java (mostly), the
stability and (mostly) readability.
 
C

Claudio Nieder

J

Joshua Cranmer

kramer31 said:
What is this CDATA crap? Has Sun never heard of escape characters.

CDATA is, AFAIK, the XML type that means that the text within is raw
text said:
Whenever I have to use Java's regular expression engine, it takes me
hours to do what I could do in minutes with Perl.

Why? Java's regex IS Perl's, for the most part:
Why didn't Sun just rip off Perl's regexp syntax and OOify it or make
regexes primitives?

Why not OOify it? Which do you prefer:
new RegexMatcher(new GreedyQuantifier(new Star("a")));

or:
Pattern.compile("a*");
?

I like the latter myself. Java does the former internally (read the
java.util.regex.Pattern sources). It's not terribly pretty.
 
R

Roedy Green

Whenever I have to use Java's regular expression engine, it takes me
hours to do what I could do in minutes with Perl.

It that because Perl syntax is superior or simply that you already
know Perl but don't know Java? My understanding is Java's regexes were
based on Perl's.

It may just be the docs. Have a look at my explanations.

See http://mindprod.com/jgloss/regex.html
 
T

Tom Anderson

What is this CDATA crap?

What CDATA crap?

Seriously, i don't know what you mean. CDATA is an XML thing, not a regexp
thing. I suspect you're confused. Is it that you;re using some file format
where regexps live in an XML document, and you've failed to understand the
boundary between the two?
Why didn't Sun just rip off Perl's regexp syntax and OOify it

That's exactly what they did.
Fancy-schmancy java crap.

You're an idiot. Get off my newsgroup. HTH.

tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top