If you just need a one liner:

cat file | perl -e 'print join("\n",(<>=~/\{([^\}]*)\}/g))."\n";'
 

James

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Eric G Ortego
Sent: Tuesday, August 03, 2004 10:19 AM
To: [email protected]
Subject: Re: [brlug-general] noob regex question

I would use sed
cat file | sed -e "s:{::g" | sed -e "s:}::g"


On Tue, 3 Aug 2004 08:19:45 -0700 (PDT), John Hebert <[EMAIL PROTECTED]>
wrote:
> Howdy,
> 
> I have a bunch of text with multiple tokens in it demarcated by { and 
> }.
> 
> Sample text:
> this is some {text1}. this is more {text2}. and yet some more {text3}. 
> blahdeblah.
> 
> What would a regular expression to get these tokens out of the text 
> look like, in a Perl script, say?
> 
> Thanks,
> John
> 
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - Send 10MB messages!
> http://promotions.yahoo.com/new_mail
> 
> _______________________________________________
> General mailing list
> [email protected]
> http://brlug.net/mailman/listinfo/general_brlug.net
>

_______________________________________________
General mailing list
[email protected]
http://brlug.net/mailman/listinfo/general_brlug.net

Reply via email to