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 regex confusion. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "regex confusion." Watch "regex confusion." New topic
Author

regex confusion.

ilteris kaplan
Ranch Hand

Joined: Jan 21, 2006
Posts: 38
Hello All,
Basically I am reading an url and ideally looking for "/comments-all" string. This unfortunately didn't work at all. I tried a very simple "comments" string but it didn't work either. Here's the code below, I think I am missing very simple thing here.

Stevi Deter
Ranch Hand

Joined: Mar 22, 2008
Posts: 265

ilteris,

What behavior are you seeing that makes you think this isn't working?

I ran your program (after finding the code for A2ZUrlReader.java, and found 6 matches when I passed in this page's url (http://www.coderanch.com/t/385301/java/java/regex-confusion) as the URL to be parsed. I changed the pattern in read(String) to "/comments-all" and had one hit. Both correspond to the content of this page before I added this comment.

Looks like the code works - it correctly retrieves a page and parses the page content looking for matches. What are you expecting it to do?


There will always be people who are ahead of the curve, and people who are behind the curve. But knowledge moves the curve. --Bill James
ilteris kaplan
Ranch Hand

Joined: Jan 21, 2006
Posts: 38
Hey Stevi,

Thanks a lot for your time. I realized I am dumb once again. Never ends I guess

it's working fine here.

thanks again,
ilteris
Stevi Deter
Ranch Hand

Joined: Mar 22, 2008
Posts: 265

Sometimes you just need that second pair of eyes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: regex confusion.