Thread: regex problem
View Single Post
Old 05-30-2008, 11:27 PM   #5 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Adding the ability to have whitespace in the two character classes, combined with using the x modifier, would help. In order to match line breaks you have to tell the regex engine where to expect them, there's no magic allow/disallow switch.

Code:
/(
    ((SELECT|DELETE) [A-Za-z0-9-\*,`._\s]+ FROM)
    |
    (INSERT INTO)
    |
    (UPDATE [A-Za-z0-9-\*,`._\s]+ SET)
)/x
Salathe is offline  
Reply With Quote