This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Oracle/OAS and the fly likes Regular expression - count newline characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Regular expression - count newline characters" Watch "Regular expression - count newline characters" New topic
Author

Regular expression - count newline characters

Ashish Shinde
Ranch Hand

Joined: Dec 08, 2002
Posts: 34

I have a requirement to count the number of newline characters in a varchar2 field in Oracle.
The catch is if the line starts with characters 'SS' it should be ignored in the count.

E.g.: -


should return the count as 3

Is there a way to do this using regular expression ?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Regular expression - count newline characters
 
Similar Threads
How do I find a text file is Unix or Dos format via Java API?
NewLine Problem in Regular Expressions
How to read \n in XML
Counting exact matches of substring.
Use regex for this?