[!--quoteo(post=385150:date=Jun 17 2006, 06:31 PM:name=Wildbug)--][div class=\'quotetop\']QUOTE(Wildbug @ Jun 17 2006, 06:31 PM)
[/div][div class=\'quotemain\'][!--quotec--] Are you trying to do this in PHP or at the command line with grep?
For command line, "ls -l | grep -v mp3$" seems to work just fine.
From the man page:
-v, --invert-match: Invert the sense of matching, to select non-matching lines.
For PHP, preg_grep() has the following flag (from the manual):
PREG_GREP_INVERT: If this flag is passed, preg_grep() returns the elements of the input array that do not match the given pattern . This flag is available since PHP 4.2.0. [/quote]
Well, that's definitely helpful - thanks!
However, I'm still looking for a regex
way to match a string NOT containing a specific string; it's fine and dandy that grep and PHP can do it, but I'm looking for a way to do it within regex.
Of course, I'm assuming it can be done - if not, just let me know!