l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
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,


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


----- 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
> DDL I'm doing searches and replaces.  the source data looks like (at least
> the important bits):
> INITIAL 555053
> NEXT 11111
> ie I have a keyword followed by N spaces/whitespace then a sting or
> 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
> ending on a
> word boundary, then find any digits/alphas surrounded optionally by "
> them) and ending on a word boundary.  Then replace the first saved part
> the first saved part, replace the second saved part with a replacement
> 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

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
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.