l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
January 6: Social gathering
Next Installfest:
TBD
Latest News:
Nov. 18: Club officer elections
Page last updated:
2001 Dec 30 17:06

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Regex question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Regex question



Never mind,

/(\s+)($string1)(\s+)("?)($string2)("?)/

seems to work.  Unless someone sees a sneaky bug in it

Jay

----- Original Message -----
From: "Jay Strauss" <jjstrauss@yahoo.com>
To: <vox-tech@franz.mother.com>
Sent: Tuesday, June 05, 2001 6:49 AM
Subject: [vox-tech] Regex question


> 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


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.