Mega Code Archive

 
Categories / Perl / Regular Expression
 

The s metasymbol and whitespace

while(<DATA>){     print if s/\s/*/g; # Substitute all spaces with stars } __DATA__     A 101     A A A