Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Fix: regex error with leading_digits #50

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Apr 10, 2017

  1. Fix: regex error with leading_digits

    When parsing `leading_digits` for number formats, `^` is being
    concatenated to the format, but many leading_digit formats contain the
    `|` operator. For this reason, `Format#match` returns some false
    positives. I.E., /^2|5[56]/ matches the phone number 1582380560.
    
    This commit wraps the leading_digits expression in ()s before applying
    the ^ so all of the formats must match the start of the line.
    jkronz committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    d85d43e View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2018

  1. Fix: do not insert an extra space in formatted numbers

    When we generate the national format for a given phone number,
    the output format is specified by the global_phone.json database.
    For example, New Zealand is '$1-$2 $3' where $1 is the national prefix,
    $2 is the first group of digits, and $3 is the last group of digits.
    However, when the national prefix is added to the number, we are
    erroneously inserting an extra space between the NP and the first group.
    For NZ, this results in '09 -123 1234', and for other countries it results
    in a double space: '02  1234 1234'.
    Since the spacing is included in the format specified by the DB,
    we should not need to add any additional spacing here.
    John Ledbetter committed Jan 18, 2018
    Configuration menu
    Copy the full SHA
    d7c935f View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from callrail/jl/remove-double-spaces

    Fix: do not insert an extra space in formatted numbers
    jkronz authored Jan 18, 2018
    Configuration menu
    Copy the full SHA
    c25471b View commit details
    Browse the repository at this point in the history