aspose file tools*
The moose likes Java in General and the fly likes regex help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "regex help " Watch "regex help " New topic
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: 11231
    
  16

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.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

Have you read the Javadoc for java.util.regex.Pattern? What does it say there about $?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
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: 19670
    
  18

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: regex help