X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 96BE7329F60 for ; Wed, 6 Oct 2004 01:56:30 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 10664-02 for ; Wed, 6 Oct 2004 00:56:17 +0000 (GMT) Received: from angel.lonelyplanet.com.au (mail.lonelyplanet.com.au [202.147.44.168]) by svr1.postgresql.org (Postfix) with ESMTP id AEC11329E93 for ; Wed, 6 Oct 2004 01:56:18 +0100 (BST) Received: from shiva.au.lpint.net ([192.168.61.22]) by angel with InterScan Messaging Security Suite; Wed, 06 Oct 2004 10:52:33 +1000 Received: by shiva.au.lpint.net with Internet Mail Service (5.5.2656.59) id <4G14KH24>; Wed, 6 Oct 2004 10:52:53 +1000 Message-ID: <82E30406384FFB44AFD1012BAB230B5505F40D26@shiva.au.lpint.net> From: Theo Galanakis To: "Pgsql-Sql@Postgresql. Org" Subject: Regex Date: Wed, 6 Oct 2004 10:52:46 +1000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2656.59) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C4AB3E.CB4E60D0" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.2 tagged_above=0.0 required=5.0 tests=DNS_FROM_RFCI_DSN, EXCUSE_16, HTML_20_30, HTML_MESSAGE, LINES_OF_YELLING, LINES_OF_YELLING_2 X-Spam-Level: ** X-Archive-Number: 200410/34 X-Sequence-Number: 19137 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C4AB3E.CB4E60D0 Content-Type: text/plain I know this is not a regex forum, however I had great assistance last time and thought I would ask, since the regex is looking through an SQL statement. I was trying to parse a SQL statement and get all the tables used. I'm actually doing this in Cold Fusion. I have gone as far as this (FROM | JOIN ).*(?<=INNER JOIN|LEFT JOIN|LEFT OUTER JOIN|AS|WHERE|ORDER BY) I know I need to look for FROM or JOIN and get all text within INNER JOIN,LEFT JOIN,LEFT OUTER JOIN,AS,WHERE,ORDER BY... there are various others. I have tried a forward reference however this does not work, I think it needs to be between the .[^INNER JOIN|LEFT JOIN|LEFT OUT JOIN|AS|WHERE|ORDER BY]* somehow!!! Basically the regex should return TABLEA, TABLEB from: Select * from TABLEA Inner jon TABLEB on tableb.columna = tablea.columna Cheers, Theo ______________________________________________________________________ This email, including attachments, is intended only for the addressee and may be confidential, privileged and subject to copyright. If you have received this email in error, please advise the sender and delete it. If you are not the intended recipient of this email, you must not use, copy or disclose its content to anyone. You must not copy or communicate to others content that is confidential or subject to copyright, unless you have the consent of the content owner. ------_=_NextPart_001_01C4AB3E.CB4E60D0 Content-Type: text/html Content-Transfer-Encoding: quoted-printable Regex

I know this is not a regex forum, however = I had great assistance last time and thought I would ask, since the regex i= s looking through an SQL statement.

I was trying to parse a SQL statement and = get all the tables used. I'm actually doing this in Cold Fusion.

I have gone as far as this

(FROM | JOIN ).*(?<=3DINNER JOIN|LEFT J= OIN|LEFT OUTER JOIN|AS|WHERE|ORDER BY)

I know I need to look for FROM or JOIN and= get all text within INNER JOIN,LEFT JOIN,LEFT OUTER JOIN,AS,WHERE,ORDER BY= ... there are various others.

I have tried a forward reference however t= his does not work, I think it needs to be between the .[^INNER JOIN|LEFT JO= IN|LEFT OUT JOIN|AS|WHERE|ORDER BY]* somehow!!!

Basically the regex should return TABLEA, = TABLEB from:

Select *
from TABLEA
Inner jon TABLEB on tableb.columna =3D ta= blea.columna

Cheers,
        Theo

____________________= __________________________________________________
This email, including= attachments, is intended only for the addressee
and may be confidential= , privileged and subject to copyright. If you
have received this email = in error, please advise the sender and delete
it. If you are not the in= tended recipient of this email, you must not
use, copy or disclose its c= ontent to anyone. You must not copy or
communicate to others content t= hat is confidential or subject to
copyright, unless you have the consen= t of the content owner.
= ------_=_NextPart_001_01C4AB3E.CB4E60D0--