This prints$a="a "; foreach (1..(length $a)) { print "a(".$1.")(".$2.")\n" if ( $a =~ m/^a( {$_})( )/ ) ; }
Does anyone know a way to write a single regexp ($regexp) that results in the same output when inserted into the following code?a( )( ) a( )( ) a( )( )
Thanks for any help$a="a "; while ( $a =~ m/$regexp/ ) { # or m//g, m//gc, ... print "a(".$1.")(".$2.")\n"; }
regards,
almaric
In reply to With one regexp by almaric
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |