Hi people
I need help with a simple regular expression.
I am given a PHP buffer. I need to know if the following phrase appears in it:
INSERT INTO <table name>
where <table name> is a name of a sql table. It can contain characters (upper and lower) and underscores.
Here are possible values:
INSERT INTO mytable
INSERT INTO another_table
right after the name of the table needs to be a whitespace or newline.
can anyone help me with that?
regards
Jason
help with regular expression
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Code: Select all
"/^INSERT INTO [A-Za-z0-9_]+[ \n]\$/"