This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Reading Reg exp from text file give error

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,Hira Iqbal

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

 
Hira Iqbal
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hmm what code ??

The code which read file?

the code which parse it?

or the whole code??

 
pradipta kumar rout
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to see the code ....

Its better to give the code which parse it?
 
Hira Iqbal
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok

folllowing is the codewhich read the file




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

 
Hira Iqbal
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ooopsss sorry !!

following is the code which do the parsing



 
Hira Iqbal
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Helloooooo!!!

anybody home???
 
Marshal
Posts: 79660
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Marshal
Posts: 79660
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apologies accepted

So the error was in something you hadn't shown us before?
 
Hira Iqbal
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

Regards
Hira Iqbal
 
Campbell Ritchie
Marshal
Posts: 79660
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just shows you . . . these errors appear mysteriously when you least expect them and where you least expect them.
 
And then the flying monkeys attacked. My only defense was this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic