This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes pattern matching Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "pattern matching" Watch "pattern matching" New topic

pattern matching

shankar vembu
Ranch Hand

Joined: May 10, 2001
Posts: 309
Hi, I have to search for string patterns in big strings. The pattern as well as the string in question may be noisy meaning they may contain characters that need to be escaped while employing pattern matching using regex. For this reason, when I say String.split(str), I get lot of PatternSyntaxExceptions with messages like "Dangling meta character '?' near index, Unclosed group near index 5446 etc...". Is there any tool or API which takes care of handling these noisy strings while matching patterns using regex.
shankar vembu
Ranch Hand

Joined: May 10, 2001
Posts: 309
just got carried away, huh. String.indexOf(string) will solve my problem
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: pattern matching
Similar Threads
How to do regex searches / matches data from external file
PatternSyntaxException with * in regex
Regular expression
Best practice to count a word inside a String
Remove Punctuations with regex