Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regex confusion.

 
ilteris kaplan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 265
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
ilteris kaplan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 265
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes you just need that second pair of eyes!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic