RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Simple SELECT statements
Expression
(SELECT\s(?:DISTINCT)?[A-Za-z0-9_\*\)\(,\s\.'\+\|\:=]+?)\s(?:FROM\s[\w\.]+)
Description
This finds the SELECT part of a SQL select statement. It does not find the entire FROM statement. That is a different RegEx I will post later.
Matches
SELECT * FROM table
Non-Matches
INSERT (t,a,r) VALUES (1,2,3)
Author Rating: Not yet rated. Kevin Devine
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials