lib/phonelib/phone_analyzer.rb
# replacing national prefix to simplified format
replacing national prefix to simplified format
replacing national prefix to simplified format
def with_replaced_national_prefix(phone, data)
      return phone unless data[Core::NATIONAL_PREFIX_TRANSFORM_RULE]
      pattern = cr("^(?:#{data[Core::NATIONAL_PREFIX_FOR_PARSING]})")
      match = phone.match pattern
      if match && match.captures.compact.size > 0
        phone.gsub(pattern, data[Core::NATIONAL_PREFIX_TRANSFORM_RULE])
      else
        phone
      end
    end
def with_replaced_national_prefix ( phone , data ) return phone unless data [ Core :: NATIONAL_PREFIX_TRANSFORM_RULE ] pattern = cr ( "^(?:#{data[Core::NATIONAL_PREFIX_FOR_PARSING]})" ) match = phone . match pattern if match && match . captures . compact . size > 0 phone . gsub ( pattern , data [ Core :: NATIONAL_PREFIX_TRANSFORM_RULE ] ) else phone end end
replacing national prefix to simplified format
replacing national prefix to simplified format
phone
<not_specific>
data
<not_specific>