         prices = variant.prices
         if prices
           _.each prices, (value, key) ->
-            if key.match(/^\d$/g)
+            if REGEX_NUMBER.test key
               # key is index of new price
               index = key
-            else if key.match(/^\_\d$/g)
+            else if REGEX_UNDERSCORE_NUMBER.test key
               # key is index of old price
               index = key.substring(1)
 

Product Utils class
###
class ProductUtils extends Utils

  diff: (old_obj, new_obj) ->
    # patch 'prices' to have an identifier in order for the diff

      prices = diff.masterVariant.prices
      if prices
        _.each prices, (value, key) ->
          if REGEX_NUMBER.test key
            # key is index of new price
            index = key
          else if REGEX_UNDERSCORE_NUMBER.test key
            # key is index of old price
            index = key.substring(1)

