$line = get_line(); # or whatever

$line =~ /"\s[^" ()]+[)]/;

The " at the beginning will match to a quote followed by a space (\s).  Then
we match any character not in the character class [" ()] (by prepending it
with ^.  Finally, we match the literal ) [)].  This is what you
described...I don't know if it will work for your app or not, but there it
is!

Good Luck!
Tanton

-----Original Message-----
From: Chris Rogers
To: Beginners@Perl. Org (E-mail)
Sent: 8/30/2001 3:18 PM
Subject: Confusion with Regular Expressions

While regular expressions are one of the most powerful aspects of Perl,
they
are probably my weakest point.  I have a string that is quite irregular
and
am trying to fix it using a regex.  What I need to do is find a
substring
that begins with a quote then a space then any characters (not including
quote, space, open parenthesis, or close parenthesis) and ends with a
close
parenthesis  Here is the string:

("APPLICATION" "MSWORD" ("name" Liste des numéros de téléphone.doc) NIL
NIL
"BASE64" 61658 NIL ("attachment" ("filename" Liste des numéros de
téléphone.doc)) NIL)

The portion of the string that is:

Liste des numéros de téléphone.doc

should be enclosed in quotes.  Chapter 5 in the Camel book has again
completely confused me and I have tried many different regex's to
accomplish
this over the last two days but have had very little luck.  Any help
would
be greatly appreciated.

Thanks,
Chris

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to