I have found
http://www.regular-expressions.info/quickstart.html very helpful working with regex's. Lots of good examples.Also whats happening when you get an uninitialized value error is that part of your regular expression is not working and returning blank results within the (). Also I found tools like
http://www.txt2re.com/ or Eclipses regex tool to be helpful in debugging my regex commands.
-- Grey Fox
"We are grey. We stand between the darkness and the light" B5