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 )

Monday, November 7, 2011

Perl regexp grouping

A group which has ? after it to make it optional will 'use up' a grouping variable whether or not it gets matched. So

/(a)?(b)/

will place "b" in $2 whether matched against "ab" or "b".

Followers

Blog Archive