| Author |
java.util.Matcher help please!
|
Mark Baldwin
Greenhorn
Joined: Aug 04, 2011
Posts: 9
|
|
Hi all,
java.util.regex.Matcher doesn't seem to be working the way I want it to work:
Expected output:
Output:
What's up with this?
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3793
|
|
|
Because you've got the .* at the beginning and end, the pattern will match against the entire string. Maybe a simpler expression like "@([a-zA-Z_0-9]*)@" would do what you want?
|
 |
Mark Baldwin
Greenhorn
Joined: Aug 04, 2011
Posts: 9
|
|
|
It did. Thanks friend. Regexp isn't my forte
|
 |
 |
|
|
subject: java.util.Matcher help please!
|
|
|