user3551812
user3551812

Reputation: 3

Regx for finding links with same begining and different ending

I need to find following kind of links having the same beginning but a different ending.

http://www.domain.com/buy/best%20iphone%20leather%20case.html

the links always start with http://www.domain.com/buy/ but can end with different links:

best%20iphone%20leather%20case.html
best%20ipad%20chargers.html
etc..

Upvotes: 0

Views: 41

Answers (2)

PradyJord
PradyJord

Reputation: 2160

Your start string is fixed so will just have to use:

^http://www\.domain\.com/buy/.*\.html

^ is used in regular expression to point beginning with 'string/word/character'.

You may have to escape '/' and '.' putting '\' just before these characters.

Upvotes: 1

Amit Joki
Amit Joki

Reputation: 59232

Use this regex:

^http://www\.domain\.com/buy/.+?html

Upvotes: 0

Related Questions