Page 1 of 1

Adhoc regex

Posted: Fri Oct 03, 2008 3:22 pm
by ngungo
I've been trying to figured out a pattern to match this:
- A non-space string that
- starts with 'http'
- ends with 'jpg'
- and NOT contain 'mysite'

I came up with something 'almost' like that, but could not figure out how to NOT the 'mysite' part. Any hint would be appreciated!

Code: Select all

$pattern = '/http[^\s]*?mysite[^\s]*?jpg/';