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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details 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
   Displaying page 1 of 1 pages; Items 1 to 1

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