Manage Edit Post Logout Login

sambrightman’s posthaven

random crap

« Back to blog

Another Perl (/regex) trick

Courtesy of this stackoverflow answer (and that via http://bloggernitin.blogspot.com/2007/12/regex-for-doesnt-contain.html), how to match for string not containing another string:

^((?!my string).)*$
Upvote Upvoted 0
Tweet
Like this post?
Subscribe by email » We'll email you when there are new posts here.
You're following this blog. Unfollow »
Follow this Posthaven »
Enter your email address to get email alerts about new posts on this site. Unsubscribe anytime.
Email address is invalid.
0 responses
Add Website URL »

Sam Brightman

Posted