Bookmark Topic Watch Topic
  • New Topic

Unable to get an idea for REGULAR EXPRESSION  RSS feed

 
Swapna latha
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have two strings like this:

1)PDY_24.45_USD_ASTRO
2)PDY_24.45USD_ASTRO

I need to replace 24.45_USD and 24.45USD as *

What I have written is

final String REPLACEDIGITS= "(\\d*\\.\\d*)(\\_)(\\w{3})";

But its working for one and not for other. If I remove \\_ it works for other. But I want a reg exp which will be working for both. Any solution for ignoring _


thanks

swapna
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Report post to moderator
You already have a thread for this: http://www.coderanch.com/t/618095/java/java/Regular-expression-java

Please continue the discussion there.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!