Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^([s|S][e|E][l|L][e|E][c|C][t|T])\s([a-zA-Z0-9\-_]+|\*),?([a-zA-Z0-9\-_]+)*\s([f|F][r|R][o|O][m|M])\s([a-zA-Z0-9\-_]+),?([a-zA-Z0-9\-_]+)*(.*);$
/

Description

matching any SQL query starting by "SELECT foo,bar FROM fool,baz {...}" this one is the good one. first one have a matching alowing * in the FROM statement.

Submitted by klmmlk - 9 years ago