in reply to Newbie regex question

I'll just offer a bit of commentary on the above regex we have to escape the $ with a \ to get \$ so the Perl interpreter won't expect a variable there instead of the literal $. Then we do (.*?) This does a non-greedy match of . (basically anything besides newline) 0 or more times... the question mark makes the previous repeater non-greedy which means it'll match as few characters as it can while still matching your regexp. Then we saw we want to match \* again we escaped because * is a special character and we want it 3 ({3}) of them. The stuff between your first set of parentheses is in $1 so there ya go.