Ad
  • Custom User Avatar

    Interesting and clever approach in my humble opinion, but 'var' declaration is also a little bit important I think. ;-)
    In addition as for used regular expression - it's not necessary to use caption groups here in alternatives, also in the first parameter in the callback we get the whole match instead of caption group. You can simply verify it.

  • Default User Avatar

    after seeing this solution I think I understand regex a bit more. Very clever.