• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regex  RSS feed

 
Vishal Alhat
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell gud book or resouce for regex?
I wanna validate string for particular patterns

following are some of them
1) We have different types of strings like number (Year) followed by string

E.g Balance sheet (€m) 2006 2007 2008 2009e 2010e 2011e

"e"is of intrest but should be followed by numbers (years) e.g above 2009e
i use replaceAll like
tempLine=tempLine.replaceAll("[^0-9 eE]", "").trim();

tempLine containing "Balance sheet (€m) 2006 2007 2008 2009e 2010e 2011e "


2) "1Q/08", 4Q/08 - number "Q" slash followed by number(year)

how can we chk something followed/ preceded by something ?


 
Aditya Kanitkar
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case i would use Kathy Sierra & Bert Bates....
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lesson: Regular Expressions from Sun's Java Tutorials
Using Regular Expressions in Java
Java Regular Expression Test Page

Also have a look at the API documentation of the java.util.regex package.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!