aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Regular expression not finding string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Regular expression not finding string" Watch "Regular expression not finding string" New topic
Author

Regular expression not finding string

O. Ziggy
Ranch Hand

Joined: Oct 02, 2005
Posts: 430

In the following example:



The m.find() method is always false so it is not finding the string "water". What is the reason for this?
O. Ziggy
Ranch Hand

Joined: Oct 02, 2005
Posts: 430

Ok worked it out. The strings are inverted. It is supposed to be



Not the other way round.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regular expression not finding string
 
Similar Threads
Whizlabs question... their explanations seems weird to me
java regex
When "\'something'" or "\\'something'" will not compile
Regular expression to take last word in a string
doubt on group() in Matcher class