Thursday, April 29, 2010

RegEx to match image source tag

Trying to build my skills around regular expressions. This is my first RegEx that matches the image source tag in the packet in any form. You may try matching the examples at ha.ckers.org (selective). It is still in the beta phase so the author is never to be held responsible for any consequences :P

m/(<|%3C)(\s*)(\n*)(\s*)(i|%69|%49)(m|%6D|%4D)(g|%67|%47)(\s*)(\n*)(\s*)(s|%73|%53)(r|%72|%52)(c|%63|43)(\s*)(\n*)(\s*)(=)(\s*)(\n*)(\s*)[^\x20]+(>|%3E)/i)

This regular expression checks for the regular syntax of image source tag even if each characters in the url are put into separate lines like.


binaryhax0r

No comments:

Post a Comment