Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Substitute

  • s/PATTERN/REPLACEMENT/
  • s{PATTERN}{REPLACEMENT}
$line = "abc123def";

$line =~ s/\d+/ /;       # "abc def"


$line =~ s{
      ([a-z]*)
      (\d*)
      ([a-z]*)
      }
      {$3$2$1}x;        # "def123abc"