using reg expression

I have a table called test with the names of column col1, col2.

col1 value: 1234. col2 value: 1547

I need o/p as 14 digits IE common present in the two columns.how to find it using reg expressions.

Hello

Here's another way, according to your needs:

SELECT ename, empno, mgr

, REGEXP_REPLACE (REGEXP_REPLACE ("0123456789")

, '[^' || To_char (empno) | ] »

)

, '[^' || To_char (mgr). ] »

) AS common_digits

FROM scott.emp

ORDER BY ename

;

The output does not include duplicate numbers, and the numbers will be in the order 0, 1, 2,..., 9, like this:

ENAME, EMPNO, MGR COMMON_DIG

---------- ---------- ---------- ----------

7876 7788 78 ADAMS

7499 7698 79 ALLEN

7698 7839 789 BLAKE

7782 7839 78 CLARK

7902 7566 7 FORD

7900 7698 79 JAMES

7566 7839 7 JONES

KING 7839

7654 7698 67 MARTIN

7934 7782 7 MILLER

7788 7566 7 SCOTT

SMITH, 7369 7902 79

7844 7698 78 TURNER

DISTRICT 7-7698-7521

You can get the same results without regular expressions, perhaps more effectively.

Tags: Database

Similar Questions

  • How to format a value by using reg expression

    Please, I need to format a value using regular expressions.
    9911223344, 9911223344
    9911223344
      11223344
    Result
    (99) 1122-3344, (99) 1122-3344
    (99) 1122-3344
    1122-3344
    Some tips on how I can do this?

    Kind regards

    Hello

    You were close.
    The first 2 digits are optional, so add a '?' in the model.
    This means that you will get results like ' ((1122-3344'), so use REPLACE to get rid of unwanted brackets.

    SELECT  REPLACE ( REGEXP_REPLACE ( val
                                , '(\d{2})?'     -- ? added here
                               || '(\d{4})(\d{4})'
                                , '(\1) \2-\3'
                         )
              , '() '
              )       AS formatted_val
    FROM    t
    ;
    

    This assumes that "()" does not happen in the raw val. If so, use the REGEXP_REPLACE calls; a search of numbers with eactly 8 digits and the other looking for numbers with exactly 10 digits.

  • Of-Rube my code please Reg Expression maybe?

    Hi all!

    I will avoid solutions based text, but after looking at my code, I thought I can get a chance to learn a better way to do it.

    Problem:

    In LV 8.6 there is a problem when an individual 'node' in a VRML file result LV to crash if I try to open a file containing this node.

    Solution:

    Wirte code to check the file and remove the cruelest bad 'node' of trying to open it.

    IF this code works, but screams "This could we better using Reg expression?"

    I think the picture tells the story.

    NOTE: The case of non-visalbe just do the wires.

    THEN, share your thoughts please.

    Ben

    Even better than my original.  This is the beginning of the selection followed until the first byeverything '} ' (and line break).

    Kudos to ben64 for the tip.

  • I get errors saying found protocols SMTP port 25. I am unable to use Outlook Express but navigation works very well.

    original title: ERROR MESSAGE not FOUND PROTOCOLS SMTP / PORT 25, ETC. don't CAN NOT USE OUTLOOK exp. reg.. INTERNET WORKS FINE

    SOME SELLERS AND MUNICIPAL SITES INSIST YOU USE 'OUTLOOK EXPRESS' THAT MY COMPUTER does not RECOGNIZE no - NO PROBLEMS WITH INTERNET REGULAR, cable INTERNET, etc - ERROR MESSAGE ABREVIATED: "host not found, server pop3 - smtp port 25, @ 11001" Protocol ".

    computer is a HP 64 bit model "pavillion a1600n.
    Should I complain to comcast?
    Gordon Derman
    E-mail address is removed from the privacy *.

    Take a look at this with Comcast links.

    Setting up email in Outlook Express servers:
    http://www.Microsoft.com/Windows/IE/community/columns/mailserver.mspx

  • One for the era: how to get this output using REGULAR EXPRESSIONS?

    How to get the bottom of output using REGULAR EXPRESSIONS?
    SQL> ed
    Wrote file afiedt.buf
    
      1* CREATE TABLE cus___addresses    (full_address                   VARCHAR2(200 BYTE))
    SQL> /
    
    Table created.
    
    SQL> PROMPT Address Format is: House #/Housename,  street,  City, Zip Code, COUNTRY
    House #/Housename,  street,  City, Zip Code, COUNTRY
    SQL> INSERT INTO cus___addresses VALUES('1, 3rd street, Lansing, MI 49001, USA');
    
    1 row created.
    
    SQL> INSERT INTO cus___addresses VALUES('3B, fifth street, Clinton, OK 74103, USA');
    
    1 row created.
    
    SQL> INSERT INTO cus___addresses VALUES('Rose Villa, Stanton Grove, Murray, TN 37183, USA');
    
    1 row created.
    
    SQL> SELECT * FROM cus___addresses;
    
    FULL_ADDRESS
    ----------------------------------------------------------------------------------------------------
    1, 3rd street, Lansing, MI 49001, USA
    3B, fifth street, Clinton, OK 74103, USA
    Rose Villa, Stanton Grove, Murray, TN 37183, USA
    
    SQL> The REG EXP query shouLd output the ZIP codes: i.e. 49001, 74103, 37183 in 3 rows.
    Published by: user12240205 on June 18, 2012 03:19
    /* Formatted on 2012/06/18 17:25 (Formatter Plus v4.8.8) */
    SELECT REGEXP_SUBSTR ((REGEXP_SUBSTR (full_address, '[^,]+', 1, 4)), '[[:digit:]]+') RESULT
      FROM cus___addresses
    
  • using reg exp

    Hello

    I need to extract the first file name token (and not the directory path) of a string like this:

    D:\MIRACLE\UPLOADS\1361\HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62
    HG-ouA02 #xaldb #alertlog_contents #22022010111941.mirdf.loadfailed_240210095258_62
    \HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62
    /Hg-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62

    the chips would be bed HG-ouA02 in all cases

    Could you help me create a reg expression to get the token?

    Best regards
    Mette

    Hello

    Whenever you have a problem, it helps if you post your sample data in a form, people can use.
    CREATE TABLE and INSERT statements are great. therefore:

    CREATE TABLE     table_x
    AS          select 'D:\MIRACLE\UPLOADS\1361\HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62'
                   AS filename, 1 as x_id FROM dual
    UNION ALL     SELECT 'HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62'
                   AS filename, 2 as x_id FROM dual
    UNION ALL     SELECT '\HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62'
                   AS filename, 3 as x_id FROM dual
    UNION ALL     SELECT '/HG-ORA02#xaldb#alertlog_contents#22022010111941.mirdf.loadfailed_240210095258_62'
                   AS filename, 4 as x_id FROM dual
    ;
    

    It also helps if you explain how you get the results you want from these data.

    Assuming that
    (a) the name of file is divided, firstly, by ' / ' or ' \' characters, and
    (b) each of these parts can be subdivided into tokens by '.' or the characters ' # ' and that
    (c) we want the first part (b) of the last (part a):

    SELECT     REGEXP_SUBSTR ( REGEXP_SUBSTR ( filename
                              , '[^/\]*$'
                              )
                    , '[^.#]+'
                    ) AS token_1
    FROM     table_x;
    

    Here the inner circle REGEXP_SUBSTR finds the last part delimited by / or \. You can add other delimiters by placing them in square parentheses, anywhere after ^.
    The external REGEXP_SUBSTR works on the results of the Interior. He returned the first part bounded by. or #. Again, you can add other delimiters.

  • I want to use the expression editor control in a DLL VC ++ how?

    Hello

    as mentioned I want to use the expression editor control in my DLL written with VSC ++ 2005 MFC. But I came across some problems:

    If I simply add the ExpressionEdit control in the toolbar to my dialog box then the dialog box will appear not during execution. As soon as I remove the control from the dialog box appears.

    In the examples of TS is a called "TCL" (...) Instruments\TestStand national 4.1.1\Examples\Tcl\source\EditSubstep). It is programmed in C++ and uses the expression editor control.

    The original dll works fine, but as soon as I compile the editsubstep with my VS 2005 I get a runtime error (see image).

    What should I do to be able to use this control?

    Does anyone have an example of a job for me?

    Frank has soon

    Hi, I found the solution and now it works fine.

    I just had to enable support for OLE controls in my dll.

    Nevertheless, thanks for your help!

    BOOL CMyDLLApp:: InitInstance()

    {

    CWinApp:: InitInstance();

    AfxEnableControlContainer();  enable support for OLE controls

    Return TRUE;

    }

    Frank has soon

  • Using Outlook express, can send but not received since getting Hughesnet

    I got Hughesnet installed on that date.  I use Outlook express and when Hughes went online I got my email to * address email is removed from the privacy * but I can't send from there.  I tried everything in the book except a call i2k.   is there something that I can fix it myself?  Thanks for your help

    Hi Nancy,.

    As mentioned by Bruce Hagen, it is very important that you provide an error message to make it easier to solve problems. However, you can check if this article helps.

    Troubleshooting error messages that you receive when you try to send and receive e-mail in Outlook and Outlook Express

  • Can't send or respond to an e-mail using Outlook Express.

    I am able to receive emails on my desk but I can't send or answer. I use outlook express.

    original title: Angela

    Angela,

    chk these links

    http://www.ehow.com/how_6820567_fix-Outlook-Express-Windows-XP.html

    http://www.ehow.com/about_5571967_problems-Outlook-Windows-XP.html

    http://Windows.Microsoft.com/en-us/Windows/email-problems-help

  • Adding electronic signature from a file by using outlook express 6

    I use Outlook Express 6 for my emails and I'm trying to set up a signature to email when I send emails. I have no problem that when inserting in the text to help: Tools > Options > Signature > and selecting text in the section change Signature, and then by typing the text in French - it works very well.

    The problem is, I want to add a signature to a file that has color, different fonts and a logo. I tried to do to help to change Signature, and then click Add files, and then browse to select the file. He refuses to use the file for the signature to e-mail. I tried to save the file as a rich text, web page, pdf, and Word but still get the following message - WARNING: the signature file is not a valid text file. I even tried to copy / paste - still nothing. I'm out of ideas. Please can someone help?

    If you can not manually insert it into a new message, you can't have a sig out of it.

    Note: The HTML Signatures must be less than 4 KB.

    Open a new Message window and create your signature. (Insert the graphic & text). Click on the Source tab (view |) Source Edit if not already checked). Highlight the complete source code and copy / paste into Notepad. File | Save under and in the file name field, save as htm, (i.e. Sig1.htm). It will be saved in My Documents by default. Go to tools | Options | Signatures. Click: File | Browse and insert your saved signature | Apply. You can now rename it if you wish.

    Bruce Hagen ~ MS - MVP [Mail]

  • Have Wdws XP using Outlook Express. Recently had work on computer. All of a sudden all the old emails deleted coming on Inbox. (Over 2500) Back in early 2010. Electronic mail stops. What is the problem?

    I have Wdws XP and using outlook Express.

    Work done recently on my computer, and now all the old emails that I had deleted in early 2010 are coming into my Inbox, (over 2500). I guess it is the overload that stops at the email, so I can't receive new messages.

    Thases e-mails had been permanently deleted, supposedly. From which they come, and how can I fix it?

    You had a frame that says "leave a copy of messages on the server. There is another setting that says "remove when deleting server ', but it was not selected.

    Outlook Express knows the messages that he has already recovered, but this information is a lost if you, for example, recreate your e-mail account. Then all messages go down again if they were left on the server.

    If the extraction has ceased, it might be because...

    one) you forced by cancellation or may be disconnected from the internet (in which case there are more to come), or

    (b) he finished, in which case old emails cannot be retrieved again (unless you are replicating what just happened), all mail must be picked up

    To avoid what is happening in the future...

    (a) according to the State of the parameters mentioned above, you may need to delete messages via webmail, and/or

    (b) to change the settings

    To change the settings...

    • Click on tools
    • Click on accounts...
    • Click on the Mail tab
    • Highlight (click) your e-mail account and then click on the properties button
    • Click the Advanced tab

    3 background settings are what control the things...

    "Leave a copy of messages on the server.

    "Remove from server after x days.

    "Remove the server after deleting in" deleted items "

    Adjust them as see fit you.

    Tricky

  • I use Outlook Express messaging in Windows XP. How can I change the "READING" of West Euro (ISO) (Windows)? (ISO is default, NO selecttion option)

    I use Outlook Express messaging in Windows XP. Display Hebrew characters of the name of the sender and the subject? and the body of the message often appears in giberish (I guess it's ASCII). My ' READ' international property is Euro (ISO), West it is grayed and I have no option to Western Euro (Windows), (no drop-down option). My "send " is OK, I had a choice, and it's on (windows).

    [Transferred from Internet Explorer]

    Hello

    You can see these articles:

    http://www.pinyinjoe.com/FAQ/Outlook-Chinese-display.htm

    http://www.pinyinjoe.com/pinyin/ea_setup.htm

    http://www.pinyinjoe.com/FAQ/change-language-for-non-Unicode-programs.htm

  • I use OUtlook Express for e-mail. Night that suddenly disappeared from the value of a full year of emails - for example from October 2011 to the today October 2012. How can I get back them?

    I have been using Outlook Express 6 for more than 20 years without a single problem so far. Value of a full year of emails has disappeared all of a sudden my box but all e-mail messages seem to be always in place of my sent folder.

    How can I recover these e-mails Inbox?

    Two reasons the most common for what you describe is disruption of the compacting process, (never touch anything until it's finished), or bloated folders. More about that below.
     
    Why OE insists on compacting folders when I close it? :
    http://www.insideoe.com/FAQs/why.htm#compact
     
    Why mail disappears:
    http://www.insideoe.com/problems/bugs.htm#mailgone
     
    Recovery methods:
     
    If you are running XP/SP3, then you should have a backup of your dbx files in the Recycle Bin (or possibly the message store), copied as bak files.
     
    To restore a folder bak on the message store folder, first find the location of the message store.
     
    Tools | Options | Maintenance | Store folder will reveal the location of your Outlook Express files. Note the location and navigate on it in Explorer Windows or, copy and paste in start | Run.
     
    In Windows XP, the .dbx files are by default marked as hidden. To view these files in the Solution Explorer, you must enable Show hidden files and folders under start | Control Panel | Folder options | View.
     
    Close OE and in Windows Explorer, click on the dbx to the file missing or empty file, then drag it to the desktop. It can be deleted later once you have successfully restored the bak file. Minimize the message store.
     
    Open OE and, if the folder is missing, create a folder with the * exact * same name as the bak file you want to restore but without the .bak. For example: If the file is Saved.bak, the new folder should be named saved. Open the new folder, and then close OE. If the folder is there, but just empty, continue to the next step.
     
    First of all, check if there is a bak file already in the message. If there is, and you have removed the dbx file, go ahead and rename it in dbx.
     
    If it is not already in the message, open the trash and do a right-click on the file bak for the folder in question and click on restore. Open the message store up and replace the .bak by .dbx file extension. Close the message store and open OE. Messages must be in the folder.
     
    If messages are restored successfully, you can go ahead and delete the old dbx file that you moved to the desktop.
     
    If you have not then bak copies of your dbx files in the Recycle Bin:
     
    DBXpress run in extract disc Mode is the best chance to recover messages:
    http://www.oehelp.com/DBXpress/default.aspx
     
    And see:

    http://www.oehelp.com/OETips.aspx#4
     
     
     
     
    A general warning to help avoid this in the future:
     
    Do not archive mail in default OE folders. They finally are damaged. Create your own folders defined by the user for mail storage and move your mail to them. Empty the deleted items folder regularly. Keep user created folders under 300 MB, and also empty as is possible to default folders.
     
    Disable analysis in your e-mail anti-virus program. It is a redundant layer of protection that devours the CPUs, slows down sending and receiving and causes a multitude of problems such as time-outs, account setting changes and has even been responsible for the loss of messages. Your up-to-date A / V program will continue to protect you sufficiently. For more information, see:
    http://www.oehelp.com/OETips.aspx#3 
     
    And backup often.
     
    Outlook Express Quick Backup (OEQB Freeware)
    http://www.oehelp.com/OEBackup/default.aspx  
  • Unable to use Outlook Express 6

    I have Outlook Express 6 and have never been able to use it, I've been using Firefox, but it certainly would be nice to use to be able to use Outlook Express.
    I know that the problem is with my incoming and outgoing server name, I don't know what is the correct name to use. Please someone help me.
    The error messages appear at the beginning of the session. These are the 2 error messages:

    The host 'SMTP' could not be found. Please check that you have entered the server name correctly. Account: 'House', server: 'SMTP', Protocol: SMTP, Port: 465, secure (SSL): Yes, Socket error: 11001, error number: 0x800CCC0D

    The host 'SMTP' could not be found. Please check that you have entered the server name correctly. Account: 'House', server: 'SMTP', Protocol: SMTP, Port: 465, secure (SSL): Yes, Socket error: 11001, error number: 0x800CCC0D

    Leo Hau - * address email is removed from the privacy *.

    You need to contact your email provider for the name of user and password and the server names and ports to use.   Without this information, you won't be able to use it.  See your email provider's website and see if they have the correct settings for OE.

    Steve

  • When you use Outlook Express from home I can send and receive emails, but when I'm away from my connection at home I can only receive emails.

    Problems using Outlook Express offline at home

    I get an error message when I try to send e-mails, would it be possible to send and receive e-mails via Outlook Express from another connection. I hope someone can help, thank you.

    Jack

    Always display the complete text and correct all errors when you ask about a problem.

    ISPS don't like people using their networks to forward mail from other networks.  The symptoms you describe are usually the result of not properly is authenticating with the outgoing server or the use of a non encrypted SMTP connection (that is, port 25 instead of 587 or 465 or whatever your email port provider requires for encryption).

Maybe you are looking for

  • Qosmio G40 Hotkeys freezing issues

    Hi all I just bought a G40 - 11Z and I feel a kind of "lag" every time I have point to the top of the screen to select a keyboard shortcut or whenever I use the button function + F *.It is very annoying, the computer freezes at least for 10seconds wh

  • Full load of Windows 7 on Presario CQ61-223TU

    I want to load a full copy of Windows 7 on an older Presario with a new hard drive. How can I get into the BIOS setup and then change to I can boot from the DVD. I hope someone can help.

  • How to change the name of a system folder on the XP computer I currently own

    I want to change the name of the system folder. When you open a file, it says the name of the document\ system I want to change\ folder locateing is the name. Please help me.

  • Why my computer wanting never dick perfom acheck had us than before

    When I started my computer got a message that he needed a check disk or I could cancel it by pressing any key and the time allowed to type the key increasded each time?  I have never received this message >

  • Error message when you try to connect to Vista

    When I type my password in the login screen of Vista during startup, I get the following error message: "The instruction at 0xff229000 referenced memory at 0 x 00000065. The memory could not write. » I click on OK, then I'm back at the password promp