Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.

Quick

  • ($a, $b....) = unpack("A2A7...", $packed)
  • push( array, list )

Wednesday, October 20, 2010

\b in regular expressions

You cannot match a string, which starts with a non-word character, at a word boundary.

$staff = "Elgin \@Stevens BOSS"; # Elgin @Stevens BOSS

s/\b\@Stevens/Dr Stevens/;

Nothing happens because \b is defined as a change from \W to \w, which by definition cannot occur between space and @, because @ is \W.

Followers

Blog Archive