A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
EJB 3 in Action
this week in the
EJB and other Java EE Technologies
Java in General
Regular Expression in String
Joined: Jul 20, 2006
Aug 28, 2006 11:19:00
How regular expression
should look like to find the match in the string of word "amp". I want to use method String.matches(String regex).
Thank you in advance.
Joined: Jan 17, 2006
Aug 28, 2006 15:48:00
If you want the word amp (i.e. the regular expression doesnt match the amp in st
) the you would use:
boolean match = myString.matches("\\bamp\\b");
[ August 28, 2006: Message edited by: Garrett Rowe ]
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
I agree. Here's the link:
subject: Regular Expression in String
Regular expression for valid xml
to read lines inside brackets
List to String
How can I add error handling facilities to this code?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014