File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Reading Reg exp from text file give error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Reading Reg exp from text file give error" Watch "Reading Reg exp from text file give error" New topic
Author

Reading Reg exp from text file give error

Hira Iqbal
Greenhorn

Joined: Jul 29, 2010
Posts: 26
Hi to All,

I am reading regx from a txt file in which data is written in XML format.
Now the problem is when is get the regx after reading and parsing the file .
The reg exp does not work fine. I mean matcher,matches() return false for any kind of input string.


Can anyone help in this??

Regards

Hira
pradipta kumar rout
Ranch Hand

Joined: Sep 13, 2010
Posts: 43
Hello,Hira Iqbal

Can you give the code what you have done...

Hira Iqbal
Greenhorn

Joined: Jul 29, 2010
Posts: 26
hmm what code ??

The code which read file?

the code which parse it?

or the whole code??

pradipta kumar rout
Ranch Hand

Joined: Sep 13, 2010
Posts: 43
I want to see the code ....

Its better to give the code which parse it?
Hira Iqbal
Greenhorn

Joined: Jul 29, 2010
Posts: 26
ok

folllowing is the codewhich read the file




and following is the code which do parsing .....

Hira Iqbal
Greenhorn

Joined: Jul 29, 2010
Posts: 26
ooopsss sorry !!

following is the code which do the parsing



Hira Iqbal
Greenhorn

Joined: Jul 29, 2010
Posts: 26
Helloooooo!!!

anybody home???
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38497
    
  23
Hira Iqbal wrote:Helloooooo!!!

anybody home???
Read this.

That sort of comment is an effective way of annoying everybody else and dissuading them from answering.
Hira Iqbal
Greenhorn

Joined: Jul 29, 2010
Posts: 26
Hi to All,

And sorry campBell I will be carefull next time.

However , My problem is solved looks like I was not passing the regx in a proper way.

I was writting as following \\d{1,3}

but i have to wirte it like \d{1,3}

Thanks to everyone for your responses.

Regards
Hira
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38497
    
  23
Apologies accepted

So the error was in something you hadn't shown us before?
Hira Iqbal
Greenhorn

Joined: Jul 29, 2010
Posts: 26

No ! the error was in something I did not expected to have error.....

Regards
Hira Iqbal
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38497
    
  23
Just shows you . . . these errors appear mysteriously when you least expect them and where you least expect them.
 
Don't get me started about those stupid light bulbs.
 
subject: Reading Reg exp from text file give error