A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Java in General
Author
pattern matching
shankar vembu
Ranch Hand
Joined: May 10, 2001
Posts: 309
posted
Nov 05, 2003 10:53:00
0
I have the following code
String str = new String("xyzfeatlksjdf"); Pattern p = Pattern.compile("feat"); Matcher m = p.matcher(str); System.out.println(m.matches());
Why is the result false?? I am trying to find if my word has 'feat' in it...
Shankar
Jim Yingst
Wanderer
Sheriff
Joined: Jan 30, 2000
Posts: 18670
posted
Nov 05, 2003 11:17:00
0
Compare the API for matches() to the API for find().
"I'm not back." - Bill Harding,
Twister
shankar vembu
Ranch Hand
Joined: May 10, 2001
Posts: 309
posted
Nov 05, 2003 11:33:00
0
Originally posted by Jim Yingst:
Compare the API for matches() to the API for find().
thanx jim, now i get it. gotto read more carefully.....
shankar
I agree. Here's the link:
http://aspose.com/file-tools
subject: pattern matching
Similar Threads
Regex
Help with Java Reg expr
Help (regex.Pattern): Replacing multiple consecutive character with single character
Is it possible to retrieve request parameters through pageContext ?
Find String that contains a given substring ignoring case
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter