Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Replace in string using Regex.

  1. #1

    Default Replace in string using Regex.

    I want to replace value a string if it begins with +44 to 0.

    Likewise:

    If input is +44123456 then output will be 012345.

    Please help.

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    No regex necessary for your example, but I wouldn't do it anyway: Why map a perfect international phone number to a non-canonical (national) format?

    Just in case: Replace ^\+44(.*) with 0$1 if you must
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Why not simply replace +44 with 0?
    -- Mick --

  4. #4

    Default

    Marabu,

    Thanks for your reply.

    Required for derived key Purpose.

  5. #5

    Default

    Because I want to replace only if it occurs in beginning.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.