>> I can usually figure out regexes, and this one seems simple, but it still >> eludes me-- >> >> I'm looking for a regex (or a couple of regexes) to do the following: >> >> blahblah{ab,abcd}blah --> blahblah(ab|abcd)blah >> blahblah{a,b,c}blah --> blahblah(a|b|c)blah >> >> If it's not obvious I'm trying to glob-select files like the tcsh would. >> I've got the rest, this is the last part... > > $var =~ s<{([^}]+)}><(?:@{[ ($a = $1) =~ y/,/|/; $a ]})>;
Luke's suggestion blew me away, but I finally came to deal with it. Now this one blew me away again... John, can you explain what this does? (?:@{[ stuff ]}) I'm going to do an archive search for all your replies, you come up with some amazing stuff.... - B -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>