Re: (Perl) Regular Expressions - oposite match or get the non-matches of a substring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



German Geek wrote:

> I consider myself quite good with Regular Expression, but i could
> never find out how to match something like:
> 
> "match this but not this and that"
> 
> so i would like to match the first "match this" (or "another this")
> but not "not this".
> 
> Seems pretty straight forward but i haven't found a (good) solution
> yet. 

Check out "look-around" (-behind, -ahead), here for instance:

http://www.regular-expressions.info/refadv.html

> Surprisingly i couldn't figure out how to say '/!(not) this/'. Seems

!/this/  


/Per

-- 
Per Jessen, Zürich (0.4°C)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux