• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regex Problem  RSS feed

 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to write a pattern but seems its not matching

I have



the pattern should start with http://localhost:8080/nn/searchengine/Jobs/ then should be followed by integer then optionally might contain another slash and any other char/String after this is irrelevant. The pattern should match

 
Matthew Brown
Bartender
Posts: 4568
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you have the $ near the end of your pattern? That will match against the end of the string, which isn't what you want.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abiodun Adisa wrote:I am trying to write a pattern but seems its not matching

What Matthew said.

However, you could save yourself an enormous pattern (and possibly some time) by breaking up the search, perhaps something like:regexes are relatively expensive, so you should try not to make them any bigger than needed.

Winston

[Edit] corrected pattern
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!