in reply to Extract last two digits from numbers
Assuming the number is at the end of the variable being matched, use: /\d{2}$/. the '\d' means match digits, the '{2}' means two exactly, and the '$' means end of line. Other option: /\d\d$/ (simpler).
Update: Note that L~R's regex is more specific (putting '^' first means start of line) while tachyon's regex is more relaxed, finding any 4 digit number and capturing its last two digits (using parentheses).
Another update: See L~R's reply below.
Re: (2) Extract last two digits from numbers by Limbic~Region (Chancellor) on Jan 06, 2004 at 10:23 UTC 
yosefm,
finding any 4 digit number and capturing its last two digits
Just to be clear, tachyon's regex will match the last two digits of the first set of digits in a string that are at least 4 digits long
 "The cat 1234567 in the hat"
 1234
 "Just like 3456789 he was 12345"
Cheers  L~R
Update: As duff points out below, I am an idiot. My above statement would be correct if the regex had been /\d\d(\d\d)\b/  [reply] 

 [reply] [d/l] 

 [reply] 
