> I am using this in Real Studio.  It uses the PCRE library, v7.7

Ok, in that case, you can do this:

    (?<=CREATE\s+TABLE\s+)\w+

Or this:

    (?<=CREATE\s+TABLE\s+)[^\n(]+


The "(?<= )" part there is a lookbehind, which is a zero-width
assertion - it's not included in the match result, but must still
match for the rest of the expression to succeed.

The second part depends on how you're defining your table names.

"\w" will match letters, numbers, and underscore, with "+" being "as
many as possible, at least one"

"[^\n(]+" is a negated character class, with the + it will keep
matching single characters that are not "^" in the class - in this
case until it finds a newline "\n" or an opening paren "(" - at which
point the match ends.


If you do want to go down the capturing group route, you can use
either $1 or \1 to extract the first captured group from a match
(where capturing groups are any pair of parentheses that don't start
with a question mark - anything that starts "(?" will not capture).


btw, it looks like Real Studio has some slight differences with pure
PCRE - see details here:
http://www.regular-expressions.info/realbasic.html
(I'm assuming RealBasic and Real Studio use same wrapper, though looks
like Real Studio might do other languages too, so maybe not.)


Also, if you feel like learning regex better, check the "quick start",
"tutorial" and "reference" links on the left of that page - it's a
good site.


Hope this helps. :)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/regex/message.cfm/messageid:1247
Subscription: http://www.houseoffusion.com/groups/regex/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/regex/unsubscribe.cfm

Reply via email to