Find non alpha characters in a string/email

HI,
I'm on 10g database.
I want to find out a list of email address where there are non alpha characters in an email .
Example
KEY1 EMAIL
1       [email protected]
2       [email protected]
3       AXIAP#[email protected] can i find out the emails with "#" and "-" characters only.
Thanks
Edited by: user527060 on Aug 14, 2009 8:15 AM

Hey Centinul, you have a DUP_VAL_ON_INDEX ;)
It's friday after all
SQL> with t as (
  2  select 1 key1, '[email protected]' email from dual union all
  3  select 2,'[email protected]' from dual union all
  4  select 3,'AXIAP#[email protected]' from dual
  5  )
  6  select key1
  7  ,      email
  8  from   t
  9  where  length(regexp_replace(substr(email, 1, instr(email, '@') -1), '[[:alnum:]]')) is not null;
      KEY1 EMAIL
         1 [email protected]
         3 AXIAP#[email protected]
2 rows selected.http://www.oracle.com/technology/oramag/webcolumns/2003/techarticles/rischert_regexp_pt1.html
http://www.oracle.com/technology/oramag/webcolumns/2003/techarticles/rischert_regexp_pt2.html
However regexp consume CPU, why not just simply:
SQL> with t as (
  2  select 1 key1, '[email protected]' email from dual union all
  3  select 2,'[email protected]' from dual union all
  4  select 3,'AXIAP#[email protected]' from dual
  5  )
  6  select key1
  7  ,      email
  8  from   t
  9  where  email like '%#%'
10  or     email like '%-%';
      KEY1 EMAIL
         1 [email protected]
         3 AXIAP#[email protected]
2 rows selected.if you're only interested in finding # or - occurences in an emailaddress?

Similar Messages

  • Mountain Lion Mail cannot search for non-alpha characters in Subject Lines

    Under 10.8.3, Mail 6.3 often cannot successfully find messages if the search string contains a non-alpha character.
    I have only tested this searching for Subject lines that are KNOWN to contain non-alpha characters
    Specfic examples:
    Subject starts with "[ABC..."
    Mail cannot find it if you search using "[ABC"
    Mail CAN find it if you search using just "ABC"
    Subject contains the numeral "2"
    Mail cannont find it if you enter "2" as the search string...even if you further constrain the search to "Subject contains: 2"
    Other problem characters I have found:
    The failure when using square bracket is a real pain since a lot of mailing lists are tagged using strings wrapped in square brackets.
    Sometimes it WORKS when I include multiple non-alpha characters in the search string, like "55" or "4/19"
    Anyone else see this?

    Please follow these directions to delete the Mail "sandbox" folder.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    ~/Library/Containers/com.apple.mail
    Right-click or control-click the highlighted line and select
    Services ▹ Reveal
    from the contextual menu.* A Finder window should open with a folder named "com.apple.mail" selected. If it does, move the selected folder — not just its contents — to the Desktop. Leave the Finder window open for now.
    Log out and log back in. Launch Mail and test. If the problem is resolved, you may have to recreate some of your Mail settings. You can then delete the folder you moved and close the Finder window. If you still have the problem, quit Mail again and put the folder back where it was, overwriting the one that may have been created in its place. Post your results.
    Caution: If you change any of the contents of the sandbox, but leave the folder itself in place, Mail may crash or not launch at all. Deleting the whole sandbox will cause it to be rebuilt automatically.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combinationcommand-C. In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar, paste into the box that opens (command-V). You won't see what you pasted because a line break is included. Press return.

  • Find no numbers  characters in a string

    HI, how i can find no numbers characters in a string
    By example.
    '45125454564#4545'.
    I only want to know if the string contains no number characters or not, i dont want to know the character '#'.
    Is there a function module for doing that?
    Thanks

    You can try:
    NUMERIC_CHECK
    OR
    IF var CO '0123456789'.
    ENDIF.

  • Removing non english characters from my string input source

    Guys,
    I have problem where I need to remove all non english (Latin) characters from a string, what should be the right API to do this?
    One I'm using right now is:
    s.replaceAll("[^\\x00-\\x7F]", "");//s is a string having chinese characters.
    I'm looking for a standard Solution for such problems, where we deal with multiple lingual characters.
    TIA
    Nitin

    Nitin_tiwari wrote:
    I have a string which has Chinese as well as Japanese characters, and I only want to remove only Chinese characters.
    What's the best way to go about it?Oh, I see!
    Well, the problem here is that Strings don't have any information on the language. What you can get out of a String (provided you have the necessary data from the Unicode standard) is the script that is used.
    A script can be used for multiple languages (for example English and German use mostly the same script, even if there are a few characters that are only used in German).
    A language can use multiple scripts (for example Japanese uses Kanji, Hiragana and Katakana).
    And if I remember correctly, then Japanese and Chinese texts share some characters on the Unicode plane (I might be wrong, 'though, since I speak/write neither of those languages).
    These two facts make these kinds of detections hard to do. In some cases they are easy (separating latin-script texts from anything else) in others it may be much tougher or even impossible (Chinese/Japanese).

  • Find non ascii characters on Table

    I am trying to find all non-ascii characters in a specific field on a 10.2G table.
    Any select statement that can help?
    Thanks!

    Charlov wrote:
    I am trying to find all non-ascii characters in a specific field on a 10.2G table.
    Any select statement that can help?
    Thanks!Perhaps something like this...
    select *
    from table
    where regexp_like(column,'[^ -'||chr(126)||']')Assuming you are taking ascii characters as being space to chr(126)

  • Removing Non-Ascii Characters from a String

    Hi Everyone,
    I would like to remove all NON-ASCII characters from a large string. For example, I am taking text from websites and would like to remove all the strange arabic and asian characters. How can I accomplish this?
    Thank you in advance.

    I would like to remove all NON-ASCII characters from a large string. I don't know if its a good method but try this:
    str="\u6789gj";
    output="";
    for(char c:str.toCharArray()){
         if((c&(char)0xff00)==0){
              output=output+c;
    System.out.println(output);
    all the strange arabic and asian characters.Don't call them so.... I am an Indian Muslim ;-) ....
    Thanks!

  • Remove all non-number characters from a string

    hi
    How i can remove all non-number characters from a column ? for example , i have a column that contains data like
    'sd3456'
    'gfg87s989'
    '45/45fgfg'
    '4354-df4456'
    and i want to convert it to
    '3456'
    '87989'
    '4545'
    '43544456'
    thx in adv

    Or in 9i,
    Something like this ->
    satyaki>
    satyaki>with vat
      2  as
      3    (
      4      select 'sd3456' cola from dual
      5      union all
      6      select 'gfg87s989' from dual
      7      union all
      8      select '45/45fgfg' from dual
      9      union all
    10      select '4354-df4456' from dual
    11    )
    12  select translate(cola,'abcdefghijklmnopqrstuvwxyz-/*#$%^&@()/?,<>;:{}[]|\`"',' ') res
    13  from vat;
    RES
    3456
    87989
    4545
    43544456
    Elapsed: 00:00:00.00
    satyaki>
    {code}
    I checked this with minimum test cases. It will be better if you checked it with other cases.
    Regards.
    Satyaki De.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Non US characters in login and email generation

    I have a design problem that I would like to check if anyone else has found a good solution to.
    Once you leave the safe shores of the United States your users start having names that includes all kinds of funny characters. In the good old days this problem was resolved by the fact that the HR system only handled 7 bit US ascii characters but today you are likely to have to face an HR system that supports unicode or at least some kind of character set that includes lots of non US ascii characters. I just ran some stats on my current enterprise population and it seems like about 5% of the users have names containing "strangeness".
    These strange characters causes big problems if you aren't allowed to include non US ascii characters in logins, email addresses and other generated fields. Exactly what a "strange character" is varies. RFC 5322 takes a quite liberal view towards special characters but explicitly disallows non US letters.
    The simplistic solution is to drop any character that isn't a US ascii letter. This works if the problem is names like "O'Malley" as the "'" really shouldn't be part of the user login and probably not part of an email address either(can be debated). This solution breaks down when you get to Germany or Scandinavia where your users that are called "Örjan Åhs" may not appreciate an email address of rjan.hs@your_company.com.
    What you would like to do is to convert "Örjan Åhs" to either "Orjan Ahs" or (possible) "Oerjan Aohs" but I haven't been able to find any java lab that does that conversion for you.
    Anyone that has run into this problem before and solved it?
    I wonder how certain characters in this post will be rendered on computers in different parts of the world :)
    /Martin, who long ago converted his last name (Swedish) to be 7 bit ascii compliant

    Thanks Daniel
    The code above drops any non US ascii characters which is fine in some situations but doesn't work for me as that would result in (amongst other issues) unacceptable email addresses.
    Example: The user "Jörgen Åhs" gets the email [email protected] (using drop strategy), what is needed is [email protected]
    The solution to this problem is to write a transform function and as we have about 80 non US ascii characters in character set we are using this mapping can quite easily be externalized to a configuration file.
    Good point about the preferred name. I have not seen this specific problem in my current system but it is very common in certain parts of the world i.e. people with Chinese heritage in south east Asia often have a Chinese legal name and a western name that they actually use in day to day interactions. If you base the email address of their name in HR much screaming ensures. The same thing should actually happen in the US as you are supposed to enter the name on your social security card into the HR system but that seems largely to be ignored.

  • Find Substring + 2 characters in a string

    I have the following string: 1.0000000000000000E+01
    I need to find subtring E+01 and delete it from the string.
    problem is thet 01 can be anything and changes.
    I need an expression that will find a subtring starting E+  and two characters that come after ie 01
    <removed_by_moderator>
    Edited by: Julius Bussche on Sep 15, 2009 10:31 AM

    Hi,
    Try the below code;
    Data : str(100) type C value '1.0000000000000000E+01'.
    Data : len type i.
    len = strlen( str ) - 4.
    str = str+0(len).
    This will solve the problem.
    >
    Maksims  Jegorovcevs wrote:
    > Will award points pls help.
    Do not offer points its against [Forum Rules|http://wiki.sdn.sap.com/wiki/x/FgQ].
    Regards
    Karthik D

  • How to find 2 different characters from a string

    Hi All,
    I would like to remove 'T' and 'Z' from "20110428T10:33:45Z" and convert the string in date/time. I was looking at instr function but that allows to search for one character only.
    Thans for the help.

    With 10g
    SELECT REGEXP_REPLACE ('20110428T10:33:45Z', '[T|Z]') dt
      FROM DUAL
    DT             
    2011042810:33:45
    1 row selected.For the conversion
    SELECT TO_DATE (REGEXP_REPLACE ('20110428T10:33:45Z', '[T|Z]'),
                    'YYYYMMDDHH24:MI:SS'
                   ) dt
      FROM DUAL
    DT       
    2011-04-28 10:33:45
    1 row selected.

  • Find a non-numeric character in a string

    I have a 3 strings (1) 'AB99CDEFGH0012%' (2) 'ABCDEFGH' (3) 'ABCD11'
    how do i find out a that string has non numeric characters
    Thanks

    SELECT TO_NUMBER(:String) FROM DUAL;
    is a quick way to find out :)
    A good method would be.....
    SELECT 1 FROM DUAL WHERE TRANSLATE(:String, 1234567890, '-') IS NOT NULL;
    The statement will filter out ALL numbers, leaving behind any characters, A, B, @, ~, etc...

  • RegEx Query - non alpha numeric characters

    Hi,
    On our Oracle EBS system users can paste data into the system and "strange" characters are not trapped, therefore they can paste into forms from e.g. word and include non standard characters. Sorry if that sounds vague.
    I need to be able to find the non alphanumeric chars in a table which are "breaking" an interfaced system which takes data from Oracle and puts some of it into an XML file. Other valid characters we don't have a problem with are e.g.
    !"£$%^&*()_+-=[{]};:'@,<.>/?\|
    For example, I know one character that causes a problem is the character MS Word uses to replace a dash.
    e.g. if I type:
    *this - that*
    Word changes it to:
    *This – that*
    That's a character I can't type on my keyboard, and an example of a character I'd like to be able to find using SQL.
    There are probably others, but all I would like to do is to find "non standard" characters.
    I have one sample transaction ID I know contains the funny MS dash, so this SQL returns it:
    SELECT pec.expenditure_comment
      FROM pa.pa_expenditure_comments pec
    WHERE REGEXP_LIKE (pec.expenditure_comment
                      , '(^ )|[^[:alnum:] &!"£$%^()_+=-{};:@#~,<.>/?\|]')
       AND pec.expenditure_item_id = 6445260However, it also returns other records which don't contain funny characters, so I don't think it is working correctly.
    Hence me asking for advice here. Any assistance would be much appreciated.
    Thanks

    966480 wrote:
    Hi,
    On our Oracle EBS system users can paste data into the system and "strange" characters are not trapped, therefore they can paste into forms from e.g. word and include non standard characters. Sorry if that sounds vague.
    I need to be able to find the non alphanumeric chars in a table which are "breaking" an interfaced system which takes data from Oracle and puts some of it into an XML file. Other valid characters we don't have a problem with are e.g.
    !"£$%^&*()_+-=[{]};:'@,<.>/?\|Are the square bracket characters, '[' and ']' acceptable? The code you posted below doesn't allow them.
    For example, I know one character that causes a problem is the character MS Word uses to replace a dash.
    e.g. if I type:
    *this - that*
    Word changes it to:
    *This – that*
    That's a character I can't type on my keyboard, and an example of a character I'd like to be able to find using SQL.
    There are probably others, but all I would like to do is to find "non standard" characters.Thee are some built-in character classes, such as [:print:] and [:graph:], that might make this job a little simpler for you.
    I have one sample transaction ID I know contains the funny MS dash, so this SQL returns it:
    SELECT pec.expenditure_comment
    FROM pa.pa_expenditure_comments pec
    WHERE REGEXP_LIKE (pec.expenditure_comment
    , '(^ )|[^[:alnum:] &!"£$%^()_+=-{};:@#~,<.>/?\|]')
    AND pec.expenditure_item_id = 6445260
    The hyphen character ( '-' ) has a special meaning inside square brackets. If you want to include a literal hyphen in the set, then put it at the very beginning (right after the '[') or the very end (right before the ']'); for example:
      WHERE REGEXP_LIKE (pec.expenditure_comment
                       , '(^ )|[^[:alnum:] &!"£$%^()_+={};:@#~,<.>/?\|-]')
    {code}
    The right square bracket, ']', also has a special meaning: it ends the set.  If you want to include a literal right ']' in the set, it must be the very first character.  The following code does not find the square brackets funny:
    {code}
      WHERE REGEXP_LIKE (pec.expenditure_comment
                       , '(^ )|[][^[:alnum:] &!"£$%^()_+={};:@#~,<.>/?\|-]')
    However, it also returns other records which don't contain funny characters, so I don't think it is working correctly.The query you posted, and both of my suggestions, will pick strings that start with a space, whether or not any funny characters come later. If you want to accept strings whether or not they start with spaces (just so long as they do not contain any funny characters) then lose the '(^ )|'; for example:
      WHERE REGEXP_LIKE (pec.expenditure_comment
                       , '[][^[:alnum:] &!"£$%^()_+={};:@#~,<.>/?\|-]')
    {code}
    >
    Hence me asking for advice here. Any assistance would be much appreciated.I hope that answers your question.
    If not, post some sample data (CREATE TABLE and INSERT statements) so people can re-create the problem and test their ideas.  Also post the correct results you want from the given sample data.
    Edited by: Frank Kulash on May 31, 2013 10:11 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Removing non-numeric characters from string

    Hi there,
    I need to have the ability to remove non-numeric characters from a string and I do not know how to do this.
    Does any one know a way?
    Example:
    Present String: (02)-2345-4607
    Required String: 0223454607
    Thanks in advance

    Dear NickM
    Try this this will work...........
    create or replace function char2num(mstring in varchar2) return integer
    is
    -- Function to remove Special characters and alphebets from phone no. string field
    -- Author - Valid Bharde.(India-Mumbai)
    -- Date :- 20 Sept 2006.
    -- This Function will return numeric representation.
    -- The Folowing program is gifted to NickM with respect to his post on oracle site regarding Removing non-numeric characters from string on the said date
    mstatus number :=0;
    mnum number:=0;
    mrefstring varchar2(50);
    begin
    mnum := length(mstring);
    for x in 1..mnum loop
    if (ASCII(substr(upper(mstring),x,1)) >= 48 and ASCII(substr(upper(mstring),x,1)) <= 57) then
    mrefstring := mrefstring || substr(mstring,x,1);
    end if;
    end loop;
    return mrefstring;
    end;
    copy the above program and use it at function for example
    SQL> select char2num('(022)-453452781') from dual;
    CHAR2NUM('(022)-453452781')
    22453452781
    Chao!!!

  • Removing non-english characters

    Hi,
    I'm trying to define a regular expression that helps me to replace non-english characters from a string.
    For example:
    BESANÇON
    and I need to get something like: BESANCON, or BESAN*ON.
    Could any one give me some hints?
    Max A.

    You can use the convert function:
    SELECT CONVERT('BESANÇON','US7ASCII')
    FROM dual;
    CONVERT(
    BESANCON
    1 row selected.

  • Count of characters in a string

    Hi all,
    Is there any way to find the repeating characters in the string like 'L' in the example Hello ..
    Thanks in advance,
    Nalla !
    Message was edited by: Nalla
    Nalla (Nallasivam)

    test@ORA10G>
    test@ORA10G> with t as (
      2    select 'hello' as str from dual union all
      3    select 'abracadabra' from dual union all
      4    select 'the quick brown fox jumps over the lazy dog' from dual union all
      5    select 'abcdefghijklmnopqrstuvwxyz' from dual union all
      6    select 'facetious' from dual)
      7  --
      8  select
      9    str
    10  from t
    11  where (
    12    length(str) - length(replace(lower(str),'a')) > 1 or
    13    length(str) - length(replace(lower(str),'b')) > 1 or
    14    length(str) - length(replace(lower(str),'c')) > 1 or
    15    length(str) - length(replace(lower(str),'d')) > 1 or
    16    length(str) - length(replace(lower(str),'e')) > 1 or
    17    length(str) - length(replace(lower(str),'f')) > 1 or
    18    length(str) - length(replace(lower(str),'g')) > 1 or
    19    length(str) - length(replace(lower(str),'h')) > 1 or
    20    length(str) - length(replace(lower(str),'i')) > 1 or
    21    length(str) - length(replace(lower(str),'j')) > 1 or
    22    length(str) - length(replace(lower(str),'k')) > 1 or
    23    length(str) - length(replace(lower(str),'l')) > 1 or
    24    length(str) - length(replace(lower(str),'m')) > 1 or
    25    length(str) - length(replace(lower(str),'n')) > 1 or
    26    length(str) - length(replace(lower(str),'o')) > 1 or
    27    length(str) - length(replace(lower(str),'p')) > 1 or
    28    length(str) - length(replace(lower(str),'q')) > 1 or
    29    length(str) - length(replace(lower(str),'r')) > 1 or
    30    length(str) - length(replace(lower(str),'s')) > 1 or
    31    length(str) - length(replace(lower(str),'t')) > 1 or
    32    length(str) - length(replace(lower(str),'u')) > 1 or
    33    length(str) - length(replace(lower(str),'v')) > 1 or
    34    length(str) - length(replace(lower(str),'w')) > 1 or
    35    length(str) - length(replace(lower(str),'x')) > 1 or
    36    length(str) - length(replace(lower(str),'y')) > 1 or
    37    length(str) - length(replace(lower(str),'z')) > 1
    38  );
    STR
    hello
    abracadabra
    the quick brown fox jumps over the lazy dog
    3 rows selected.
    test@ORA10G>
    test@ORA10G>pratz

Maybe you are looking for

  • How do i allow multiple pages to open in one page?

    Hi there, I want to be able to have one page with a left navigation where the viewer can click on the nav and get page content opening up on the right.  With each click of a new button on the nav, the content changes.  Like the apple site : http://ww

  • Flash Player (Safari internet plug-in) has quit unexpectedly, can you help me plz?

    here is my report... and it happens frequently: Process:         WebKitPluginHost [307] Path:            /System/Library/Frameworks/WebKit.framework/WebKitPluginHost.app/Contents/MacOS /WebKitPluginHost Identifier:      com.apple.WebKit.PluginHost Ve

  • Order Settlement and variance booking

    I require one clarification. Here one production order was created with a big quantity few months ago and the same has been completed and finished in this month. Because of this the total variance which is very huge has been posted in this month in t

  • Error in EHP4 upgrade

    Hi experts, When i am doing EHP4 upgrade to ecc 6.0, EHPI screen closed suddently at configuration phase. if i trying launch the EHPI screen it is showing below error Jul 26, 2011 8:43:27 AM [Warning]: Tool asked for unknown feature "evaluation"! Jul

  • Advance Pricing -- For Diwali Offer

    How to give advance pricing for the this diwali offer 1. For a stores, any thing worth more or equal to Rs 1000, INR purchasing bill (say Bill A) , a coupon will be issued which can be used only once for the next purchasing bill (say Bill B) which ha