| Author |
regex help
|
divya kundapur
Ranch Hand
Joined: Aug 21, 2007
Posts: 110
|
|
Hi,
I have a string= $str1$str2$str3$str4$ , what should the regex ?
this did not work "$"+str1+"$*"
Thanks
|
SCJP - 5.0
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9956
|
|
What should be the regex for what?
What are you trying to match exactly? Your question is effectively saying
"I have the string 'this is my string'. What should be the regex?"
You have to tell us what you are TRYING to match.
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Have you read the Javadoc for java.util.regex.Pattern? What does it say there about $?
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
divya kundapur
Ranch Hand
Joined: Aug 21, 2007
Posts: 110
|
|
ok, this is the string i have string= $str1$str2$str3$str4$ , and i need a regular expression to match it .. Any help appreciated.
Thank you
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Hava you read the Pattern Javadoc already? That should get you along for now. And keep in mind that you need to treat $ specially, the Javadoc explains why.
|
 |
 |
|
|
subject: regex help
|
|
|