Add zero to a number of phone & Trim spaces

Hello

I have a large list of phone numbers Mobile badly formatted and I need to store them for matching to other tables.

They sometimes miss the first "0" & others have spaces between incompatible issues.

I need to run a regular expression to correct these, can one provide a & explain how this works? Thank you.

The Normal format would be 0412345678 - that's what I want that he set up.

Currently, I have these types of formats;

412 34 5678, 0456 789 123, etc...

Can you help me please?

woof777 wrote:
Thank you fac586,

You're right, I should have posted this in the forum of PL/SQL, but for some reason any, I chose what it comes to the application, I use this script in.

In addition, apology for have seems on the formats I have, I thought you guys were all readers of mind & automatically knew what I meant. : )

Very common on this forum. (I also worked on enough data load/cleaning projects about there are always weird values, no one expects).

Your script works fine, thank you.

I want to try & explain what, in my view, that each party makes so I can learn from this.

Your script is - '0'. regexp_replace ({Tel, ' \D|^0{1} ') clean_tel

The syntax I went down a website - REGEXP_REPLACE (srcstr pattern [replacestr [, position [, instance [, match_option]]])

The | Concatenates a '0' for the output of the script inside the parentheses, "such" is the source of domain name string

Yes.

the next part is \D (matches a single character that is a digit), but I'm not sure what it is, & then, from there, I guess...

No. \D matches any character that is not a digit.

Could you explain us piece by piece, makes the rest with regard to syntax?

  • \Dmatches any character that is not a digit
  • |is an OR operator
  • ^in this context, means the beginning of thesrcstr
  • 0is a character from scratch
  • {1}is a number of exact occurrences of 1

Therefore the complete expression corresponds to "any character in the srcstr is not a number or a single zero that occur at the beginning of the srcstr '.»» As there is no replacestr , all corresponding characters are replaced with null, which is retired. We can then add a zero at the beginning of the phone number: some of the original values were missing, and we have removed all that did.

I also found that this field contains e-mail addresses, so is it possible to do something like "If the string contains a ' @' do not modify it?"

Rather than doing the rational expression more complicated (or by adding another expression of regexp), all that obvious in using an expression box:

case   when tel like '%@%'   then     tel   else     regexp_replace(tel, '\D|^0{1}') end

Validate e-mail addresses is another story...

Tags: Database

Similar Questions

  • Dynamically add zeros after a number

    Hello

    I need help to write this query.

    I want to add the number of zeros after a few dynamically.

    for example: If number is 2 and the number of zeros to add is 5 then exit final should be 200000;

    I would prefer to_char, even, it seems unnecessary here

    Select to_char(:n1). Double RPAD('0',:v1,'0');

  • Illustrator CC adds two zeros after each number (size of the pixels, the size of font etc.) (W10)

    I have this problem where Illustrator adds two zeros after each number and I can't delete them, making it impossible to use the text, lines, etc. and extra hard to decide the size, etc..

    This problem started, I think that after you install a new version of windows (but not directly). I currently use Windows 10 (14393.105) and the latest version of Illustrator CC.
    I reinstalled Illustrator in American English and Brittish English (from Swedish originally) to try and fix snack Illustrator have been mixing up of the commas and points. I rebooted the computer several times (this problem started a few weeks ago) and still nothing.

    fa5fb54bf43f06ae613c3ee5b3958bad.png

    Two zeros after everynumber with a space between the two.

    I have 2015.3.1

    This is the current version. Looks like it's a bug that came with the last update, and I do not know if the relocation will help you. (He cannot harm). You can report it here: feature request/Bug Report Form. In the meantime, I'll look around and see if I can find more information on the issue.

  • Add zero sequential file name

    I want to export a bunch of images using the Custom name - sequence as the naming convention. How can I set to always use two digital in the sequence? So, if it's under the number 10 in the order I want to add a zero before the number. Some programs that I use put image 10 after 1, followed by 11, 12, etc. I'm need to sort in the order 01, 02, 03,..., 10, 11, 12.

    The default sequence does not many zeros, but you can create a new filename template that does. For a single zero choose the sequence # (01) in the filename template editor.

  • How can I add an existing application from my phone to my Apple Watch?

    I would like to add an existing application from my phone to my Apple Watch. Is this possible?

    Hello

    Apple Watch can install applications that State "offers Apple Watch app for iPhone" in their descriptions in iTunes and the App Store.

    See, for example, dark sky information:

    - https://itunes.apple.com/gb/app/dark-sky-hyperlocal-weather/id517329357?mt=8

    To see which applications already installed on your iPhone can also be installed on your watch:

    -On your iPhone, in the application of Eve, go to: My Watch (tab) > scroll down to see the list of apps > for everything that you want to add to your watch, press the name of the application, and then enable the setting for "Show App on Apple Watch" > allow a few moments for the application to install.

  • BlackBerry Smartphones Black Berry Bold 9900 only able to ring if number in phone contact list

    Black Berry Bold 9900 only able to ring if number in phone contact list

    can someone help me solve the problem above his on optus and has just the stock of claims on this subject.

    Would appreciate any assistance.

    Perfect phone in all other respects.

    Hello and welcome to the community!

    I recommend that you try to start safe mode:

    • KB17877 How to start a smartphone BlackBerry in Mode safe

    It will take several attempts to get the combination of keys ESC (press/release/hold) OK, so be patient. When properly in Safe Mode, see what happens.

    If the behavior continues, then well... think what happened just before this behavior started? A new application? An update? A theme? Something else? Think carefully that the slightest change can be causal... and try to undo all that was.

    But if the behavior continues mode without failure, you may need to consider more drastic measures - WIPE, OS Reload, BBSAK Wipe/Reload and the process of reloading OS 'skeleton '. To prepare, you should be sure that you have a full backup of your PC... Please see the Backup link in my sig auto on this post for instructions.

    You may also use these tips:

    Good luck and let us know!

  • Find number of zeros in a number

    Hello

    I need to know the number of trailing zeros in a number. Could you please help me how do it in SQL.

    Examples

    1500 - 2 zeros

    10400 - 2 zeros

    1000 - 3 zeros.

    Thank you

    What:

    Length (to_char (your_column)) - length (rtrim (to_char (your_column), ' 0'))

  • Zero touch a number in BPEL Expression

    Is it possible to zero key a number in an expression of BPEL?  I have a number that must be 6 digits wide (080000) and sometimes with only 5 (80000).  I was hoping there was a function to do this, but I couldn't find one.

    Thank you

    Tom Henriksen

    Use xslt for the same thing: -.

    xmlns:functx ="http://www.functx.com" > "

    substring(

    string-join (

    ($stringToPad, for $i in (1 to $length) return $padChar)

    ,'')

    ,1,$length)

    ">

  • Can I add a new page to both phone and desktop in the same respective location? Is only possible manually?

    It seems that, once you create your phone site, a from there, when I add a new page for a layout or on the other, the command ' Page/go to even ' struggles. Can I create a new page and have it automatically create a page space reserved on the alternative format/site plan?

    Hello

    To respond to your request, I'm afraid that you can't add a new page to both phone and desktop in the same respective location. You must manually do the same thing.

  • Cannot add new vmdk to vm from data store space free

    Hello

    what I am doing wrong?

    When trying to add new vmdk of VM (SQL) of free space to store data, I get an error. See attach...

    I tried 19GB, 18 GB, and even 10GB... the same error. As you can see there is 19.46 GB of free space on the data store.

    Thank you.

    chances are you have snapshots or Exchange memory files using this space.

    Best practices of VMware is to leave 25 + % free on your VMFS volumes.

    I weoud suggest you use another if possible VMFS volume

  • How to add a second iPhone number to account for help a separate activity for both phones?

    All,

    My wife and I share the same apple id account. How do I add additional phone number, so we can separate the activity such as a phone log and imessage?

    We all have two iPhone 6s.

    Thank you...

    mac2jayb wrote:

    All,

    My wife and I share the same apple id account. How do I add additional phone number, so we can separate the activity such as a phone log and imessage?

    We all have two iPhone 6s.

    Thank you...

    share the same for imessage or facetime apple ID is how you separate, is not by adding an additional phone number.

    You can use the family sharing the music and applications

  • Skype blocked my number of phone bank?

    Because I can use it before and just had a problem a few days ago, he said "no response", but he did not respond if I call my phone

    Solved by contacting Skype support ... https://support.microsoft.com/en-us/skype?language=en&locale=EN-US&oaspworkflow=start_1.0.0.0&needsl . Did not know what happened, maybe they did blocked number questions or another network

  • Enter the name or the grayed out number in phone dialer

    Hello! I want to ask you if this has also happened to you. In phone dialer, the box where you can enter the name or number manually does not work. He was grey out. It happened when I upgraded to lollipop. Hope you can help me. Thank you.

    I just checked for you, and yes they are exactly the same.

    I hope this helps.

  • How to get the number of phone outgoing\incoming callUpdated phone class event.

    With 10.0\10.2 call APIs, we can get the notfication of call events, but I see no way to get out the phone number or entering via the class Call or CallCommandResponse phone number. I want to get the outgoing\incoming phone number when callstate is changed. Any help appreciated.

    http://developer.BlackBerry.com/native/reference/Cascades/device_and_communication_phone.html

    Thank you

    Atman

    This is not currently supported, but is added in a future release.

  • Add name, address & telephone number at the end of e-mail.

    Where can I go in my Hotmail so that I can add my name, address & phone numbers at the end of my email.

    Thank you

    How to add a signature...

    http://Windows.Microsoft.com/en-CA/Windows-Live/Mail-create-signature

Maybe you are looking for

  • Can not uninstall Firefox

    I'm trying to deal with a problem of Java plugin that I also followed all the rules, others have defined. Essentially, for this problem, Firefox crashes every time that Java applets try to load it and the plugin is activated. Specifically, the Java P

  • Regarding the multiple backups of the bookmark, what should I do for good mix all in a bookmark?

    I have several backups from the bookmark and I would mix in a bookmark. I used one and then open the other that it removes all bookmarks and use only the last one

  • Tab control sets

    I have two tab controls on my main table, both are responsible for the IUR even who gets the same controls and callbacks. When I run the reminder of the different tab controls I get Panel = control 4 = 93 1 tab control and Panel is 13 = 93 from the 2

  • Suddenly wifi does not work after the computer restarts

    After that I restarted my netbook, it is no longer connect to any wifi public my ipod has no problem. It seems that I can connect to the router but no internet and no ip address. When I connect woman manully, it acquires the router's ip address. I ca

  • BlackBerry Z10 who developed the Facebook app?

    Dear all, Who developed the facebook app for blackberry z10. What is RIM? or Facebook?