Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2013-11-08T13:45:54Z by smithha
tells
tells
1 Post
ACCEPTED ANSWER

Pinned topic VPHONE pattern override

‏2013-11-07T22:04:11Z |

I am using VPHONE and I am trying to standardize phone numbers that are 3096755555x123.  The issue is there is no space between the number and extension resulting in a pattern of @.

Is there anyway to have this type of pattern tokenized correctly?

We tried adding X to the SEPLIST, but that broke numbers that have EXT instead of X.

  • smithha
    smithha
    23 Posts
    ACCEPTED ANSWER

    Re: VPHONE pattern override

    ‏2013-11-08T13:45:54Z  in response to tells

    There are a few different approaches you can use to standardize this.

    1) You could add E, X, and T to the SEPLIST.  It will temporarily separate the letters, but you can also classify them (e.g. as class "X").  You would then see patterns such as:  ^ X ^  or ^ X X X ^.  The numbers are simple to tokenize in this case and the letter patterns can be concatenated back together.

    2) You could leave the resulting pattern as @.  Then in your actions, use the functions to copy leading and trailing characters.  The Pattern Action language might look like this:

    @

    COPY [1](n) {PhoneNumber}
    COPY [1](-n) {PhoneNumberExt}

    This assumes that you don't care whether the Extension token is EXT or X or something else.

    3) I'm not 100% sure you can combine substring and pict options, but possibly you could do a sequence of patterns if you need to extract an EXT vs. an X.

    @ [{} (-4:-1) PICT = "cnnn"] 

    or        @ [{} (-6:-4) = "EXT"]

    or        @ [{} (-4:-4) = "X"]

    In any of these styles, I would use the copy of leading and trailing numerics to parse the actual numbers out.

    Hope these examples help.

    Harald