• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regex help

 
divya kundapur
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a string= $str1$str2$str3$str4$ , what should the regex ?
this did not work "$"+str1+"$*"

Thanks
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12100
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the Javadoc for java.util.regex.Pattern? What does it say there about $?
 
divya kundapur
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic