Adhoc regex

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ngungo
Forum Commoner
Posts: 75
Joined: Thu Jun 08, 2006 10:45 pm

Adhoc regex

Post 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/';
 
Post Reply