| 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
|
|
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
|
 |
 |
|
|
subject: Regular Expression matching new line
|
|
|