Howdy,
I'm trying to do some text mangling in perl, I have some SQL DDL and in this
DDL I'm doing searches and replaces. the source data looks like (at least
the important bits):
TABLESPACE "SOMENAME"
INITIAL 555053
NEXT 11111
TABLE "TABLE NAME"
ie I have a keyword followed by N spaces/whitespace then a sting or numbers,
optionally enclosed by "", the whole thing is terminated by whitespace or
newline.
What I want to do is find expressions like described. Save save the
beginning part and
replace the ending part.
s/\b(\w+)\b("?(\d+)"?\b/$1,$replacement_hash{$2}/g;
What I'm attempting is:
starting on a word boundary, find 1 or more word characters (and save them),
ending on a
word boundary, then find any digits/alphas surrounded optionally by " (save
them) and ending on a word boundary. Then replace the first saved part with
the first saved part, replace the second saved part with a replacement hash
value.
But this is wrong
any help???
P.s. Linus gave an interview on NPR
http://www.npr.org/ramfiles/fa/20010604.fa.01.ram
Jay
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com