File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Regular Expression matching new line Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Regular Expression matching new line" Watch "Regular Expression matching new line" New topic
Author

Regular Expression matching new line

Himanshu Rawat
Ranch Hand

Joined: Nov 27, 2005
Posts: 141
Hi,

I got a a pattern to match in a file. File got got below contents. ( Arrows are not part of file )

-->> 1
-->> 2 a space
-->> 3 new line



I am able to match 1 and 2 like this



but not able to match 3rd one.

Please tell me how to do this?


rawat
SCJP 1.4
John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
Himanshu:

This link should help you.

John.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 16695
    
  19

It would also be a good idea to give us more than the pattern -- as the regex engine has many many ways to match something.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

John is right. You should especially check out the possible flags.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regular Expression matching new line
 
Similar Threads
MultiDimenaional Array sort
Chap:6 selftest q: 1 but in argument little more
HTTP Status 404 -
How to import CSV file into Mysql using jsp
JAX-WS @Resrouce injection still not working