This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

help with regexp

Old posts that have not been replied to for several years.
Locked
User avatar
CrazyCat
Revered One
Posts: 1359
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

help with regexp

Post by CrazyCat »

hi there :)

I've a small trouble with regexp and I wonder it might be usefull to have a small chapter added in the FAQ.

I know how to use regsub, it's quite simple... but my trouble is to use regexp returning me the different matches.

Let me give you an example:

Code: Select all

set mystring "a string with me@domain.com or yet@another.mail may return my@list.of.mails"
I want to find the way using regexp to return me:

Code: Select all

me@domain.com
yet@another.mail
my@list.of.mail
Thanx by advance
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

use "-all -inline" and regexp will return a list of matches
% regexp -all -inline . abcde
a b c d e
Have you ever read "The Manual"?
User avatar
CrazyCat
Revered One
Posts: 1359
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Thanks a lot, it works!!!
Locked