Using the REGEXP_REPLACE function

I am trying to get an understanding of the REGEXP_REPLACE function on this question and answer:

Question: Some employees have entered the product_code correctly. It should appear as a series of characters followed by a bar slash followed by another set of characters.
Instead of putting the single slash / separates the two groups of characters, some industsrie are entered in spaces, dashes, or both.

Format of all product codes by deleting all the extra spaces and hyphens and replace them with a single.

Answer: REGEXP_REPLACE (product_code, ' (()) {1,} |) (-)) {1, } ', '/')

I'm confused about the implementation of the media in the service as well as doing the tube?

I guess it's the same thing as an OR operator, but I'm not sure.

I have read the documentation on REGEXP_REPLACE oracle but I'm still not sure.

Hello

993451 wrote:
I am trying to get an understanding of the REGEXP_REPLACE function on this question and answer:

Question: Some employees have entered the product_code correctly. It should appear as a series of characters followed by a bar slash followed by another set of characters.
Instead of putting the single slash / separates the two groups of characters, some industsrie are entered in spaces, dashes, or both.

Format of all product codes by deleting all the extra spaces and hyphens and replace them with a single.

Answer: REGEXP_REPLACE (product_code, ' (()) {1,} |) (-)) {1, } ', '/')

Are you sure this is the answer given? It does not work when I try.
It seems that there are extra spaces, and I suspect some round parentheses should really be hooks, or are not really necessary.

If I understand the problem, it's a solution:

REGEXP_REPLACE ( product_code
            , '[ -]+'
            , '/'
            ) 

The brackets surround a character set. In this case, the set contains 2 members: space and dash. The sign means that we are looking for 1 or more characters in the game.

I'm confused about the implementation of the media in the service as well as doing the tube?

I guess it's the same thing as an OR operator, but I'm not sure.

Yes, the riser means 'GOLD '.

I have read the documentation on REGEXP_REPLACE oracle but I'm still not sure.

Yes, the Oracle documentation is designed as a reference, not a tutorial and parts on regular expressions are not the best, the Oracle has published.
Try these sites:
http://www.sqlsnippets.com/en/topic-10759.html
http://www.DBA-Oracle.com/t_regular_expressions.htm
Introduction to regular expressions... last part.

Tags: Database

Similar Questions

  • alternatives without using the regexp_replace function

    SELECT

    REGEXP_REPLACE (phone_number,

    "([[: digit:]] {3})------." ([[: digit:]] {3}). ([[: digit:]] {4})',

    "\2-\3 (\1)") "REGEXP_REPLACE.

    Employees;

    is there another without using the regexp_replace function...

    Another way

    (eliminating instr... function as your problem focuses on one length fixed)

    WITH t AS (SELECT '112.345.6789' FROM DUAL str).

    TT AS (SELECT REPLACE (str, '.') t str)

    SELECT ' (')

    || SUBSTR (str, 1, 3)

    || ') '

    || SUBSTR (str, 4, 3)

    || '-'

    || SUBSTR (str, 7)

    TT;

    See you soon,.

    Manik.

  • need help to get the value using the REGEXP_REPLACE function.

    I am trying to extract the value placed between "< listitems >... < / listitems >" but I am unable to get these value using the REGEXP_REPLACE function.
    select REGEXP_REPLACE('<InputParameters></ParamSet><listitems>14545454</listitems></ParamSet></InputParameters>'
    ,'(<InputParameters>.*<listitems>)(.*)(</listitems>.*<InputParameters>)'
    ,'\2') from dual;
    required output:
     1454554
    Can someone please help me achieve this goal.

    Hello

    You forgot the / before the last InputParameters. If fix you that, your code will work.

    Here is a slightly different way:

    SELECT  REGEXP_REPLACE ( '14545454'
                     , '^.*?(.*?).*$'
                     , '\1'
                     )     AS listitems
    FROM    dual
    ;
    

    Least to type, the less likely you will have to make typos.
    If there are 2 (or more) elements of listitmes, 1 will be returned.

    From Oracle 11.1, you can also use REGEXP_SUBSTR. I have Oracle 10.2 avaialable now, so I can test the following, but I think you'd say:

    SELECT  REGEXP_SUBSTR ( '14545454'
                     , '(.*?)'
                     , 1
                     , 1
                     , NULL
                     , 1
                     )     AS listitems
    FROM    dual;
    

    When it comes with the text that is or looks to, XML, consider using XML functions.

  • How doi send texts using the speech function without hitting the Send button?

    using the speech function in texting, how to send the text without actually pushing the Send button? When I say 'send' or 'send message' he just keeps typing

    "Hey, Siri, send a message to Bob. Siri will then ask you what you want text Bob. Once you stop dictating, Siri will ask then if you're ready to send the message. Say, "Yes." It's really very nice.

    If you are already in the message app and using speech-to-text, you must press the Send button.

  • Cannot use the Val function in a script use

    I'm trying to convert a text string (binary number) in a number by using the Val function in a script of use but the colors of tiara the term Val in red and the script produces an error indicating "Variable is undefined:"Val"

    Why is that happen? Some functions are not allowed in use scripts?

    In addition, it seems impossible to use debugging in my use - if I try to add a variable to the Watch window, there never have any value even if I put a breakpoint on this line of code. Would it not possible to debug scripts use?

    David,

    regarding your question on "Val" I would like to direct you to the "File.Formatter.ParseString" function which is part of the API available at DataPlugins.

    CDbl and CLng do a good job in general, but they are dependent on the local configuration of the PC. 'ParseString' is so much more reliable.

    Andreas

  • How to connect the parallel test using the logarithmic function Teststand database result

    Hello

    How can I connect a test result of 4 EHR tested in parallel using the logarithmic function Teststand database

    I use Labview 2013, 2013 Teststand and sequential model.

    The test is performed using a single digital card (SMU-6556). The FSD 4 is connected to the port of the digital map and is tested in parallel.

    Currently at the end of the test, I would have a report with all the measures, but I need 4 reports (1 report / dut)

    TKS


  • When I use the library function node call in real time, is loaded only once for all or load the DLL whenever it is called?

    When I use the library function node call in real time, is loaded only once for all or load the DLL every time when it is called?

    I have a critical application in real time, in which I use a piece of DLL function developed in C++.  It is ok?  Make sure any senior developer?

    Thank you in advance.

    The user interface thread is the thread that is used to update the user interface. It's slow. And it's supposed to be that way because humans are slow.

    The call library function node can be configured as this thread to use in the configuration for it dialog box. Please visit the LabVIEW documentation on how to do this.

  • How can I use the BCGTransform function to treat the 16-bit Image?

    Hi ~

    I use LabWindowsCVI8.5 and NI Vision to make the treatment of the Image. When I read the "IMAQ Vision for LabWindowsCVI Reference Manual", I found that the imaqBCGTransform function only supports 8-bit Image, while I do the BCG to turn on 16-bit image. Are there solutions to use the BCGTransform function to deal with the 16-bit Image? Or any other feature that could make the correction Gamma, contrast and brightness on the 16-bit Image?

    Thank you very much!

    because imaqBCGTransform is implemented as a lookup table, we can understand why it is limited to 8-bit images.

    Now let's take a look at the definition of each of this mandate (from the NI Vision Concepts documentation):

    -brightness: a constant added to the components red, green, and blue pixel of color over color, decoding of the process;

    -contrast: a constant multiplication factor applied to the components of the luma and chroma of a pixel of color in color to decoding process.

    -gamma correction: expand high gray-level information in an image while removing information of low level of gray.  (the chapter on lookup tables gives some examples of corrections gamma)

    now that you understand that this transformation is a simple mathematical function, simply calculate the correction for each pixel on your 16-bit images.

    I know not the exact formula used by the imaqBCGTransform function, but you should be able to approach by performing some tests on images 8 bits with the original function... or you can make your own formula... or find one on the net... or you can ask someone at home OR you give the formula...

  • Does anyone have an example VI for using the SendInput function in User32.dll?

    Hi all

    I am creating a VI that creates a click of the mouse.  I looked at the MSDN Web site and found that I need to use the SendInput function in User32.dll.  The problem is that some of the parameters for this function are nested structures.  How to use this function in a call library function node?  Is there already a LabVIEW wrapper for this function?

    Thank you

    MechEman

    I would use rather MouseEvent.  I looked at my VI and it can be cleaned up a bit, but it works for what you want to do.

  • Using the comparison function where 2 data tables various types

    Is it possible to use the comparison function in Labview you to compare 2 arrays of types of different data (e.g. Boolean and double-precision)?

    Would this work?  Nested for loops of index on the TRUE values of the Boolean table.

  • How to copy an image that is in format .pdf using the paint function paste in Word?

    I would like to copy a table that is in a non-protected PDF document using the paint function in accessories to paste it in a Word document that I'm working on. Please help as soon as POSSIBLE.

    Hello, Edward Namalima,.

    1. first open the pdf page you want to copy.

    2. when the page is displayed on your screen, press prtscrn on your keyboard.

    3. a copy of the screen has now sent in the windows clipboard.

    4. now open Paint.

    5. on the Paint toolbar, click on edit and then click on paste. The image will now be pasted in a Paint window. You may need to accept a dialog resize if the image is larger than the current document.

    6. now, from the toolbar to the left of your screen, click on the Selection (the oblong dotted box) tool. With the selection tool, select the entire surface of the table you want to copy. Once selected, click on modifier change again, then select Copy.

    7. now, open Microsoft Word.

    8. then place the cursor where you want the table to set, and then press the CTRL and V together on your keyboard.

    9. the image of the table should now be pasted into your Word document.

    Alternatively, you can use the cutting tool (click on the Start button and type snipping tool in the search field). Select the table you want in the pdf page using the cutting tool and then open word and paste the table in word.

    This forum post is my own opinion and does not necessarily reflect the opinion or the opinion of Microsoft, its employees or other MVPS.

    John Barnett MVP: Windows XP Expert associated with: Windows Expert - consumer: www.winuser.co.uk |  vistasupport.mvps.org | xphelpandsupport.mvps.org | www.silversurfer-Guide.com

  • Why can I not use the scanner function if my ink cartridges are not installed properly?

    The scanner allows just as one scanner I have another product of HP that I use for my printing needs? My all in one (C4580) there is an error that indicates that the ink cartridges have not been installed correctly. I have not used this printer as printer in a long time, but use it as my primary scanner. Is there anyway I can overide the "Cartridghe Print badly installed" so I can use the scanner function? Thank you for your help

    You can find information on how solve the error associated with cartridge you have about your Photosmart C4580 paper here.

    With most of the printers HP if there is a visible error on the printer screen it only lets not to copy, scan or fax.

    I hope this helps.

  • I have an officejet 6600 and I can not use the copy function. any suggestions?

    I just bought an officejet 6600 and I tried to use the copy function.  Is it possible to copy a few items @ a time on the top

    HI yankee59,

    What happens if you go to your printer and select copy on the front panel? Do you get the options to copy as many copies ect...?

  • After mac os update and software reinstall now unable to use the scan function

    Hello

    I never thought I had to post on one of them, but it really made me. I have a Macbook and stupidly thought that I would update to the mavericks os 10.9 the other day.

    I continued to be able to print once the update, but it was impossible to use the scan function. So, I removed the printer and the drivers and downloaded the new drivers which would have been compatible with os x 10.9. When I went to reinstall the printer, he couldn't locate it on the list of "available printers" - I connect using wi - fi connection at home.

    The only way I could connect the printer was installed manually by entering the ip address. It was found and I print now, so I don't think there is nothing wrong with the connectivity, but a warning when you do this that says scan function does not work, and of course the scan option is simply not there.

    Thought I have would bypass this using analysis of e-mail on the printer. It seemed to work fine, but when I received the email there was no attachment.

    My husband is now scanning these documents to his computer (a pc) and emailing for me - is not ideal.

    Any ideas on how I can fix this?

    Thank you

    Annie

    Hi Annie,.

    Here is a picture of a printer, USB cable,

    Now that I know what printer we work with, I have another idea. On the front screen of the printer please press the wireless icon. There are 4 icons in the upper part, the wireless is the second from the left. In the Menu arrow until settings wireless advanced. I would like to disable IPV6, arrow down to IPV6, and then select OFF.

    I saw the IPV6 interferes with the Hello Protocol several times, often time turning off this feature will solve the problem and allow the Mac to see the printer on the network. Once IPV6 is disabled try to add the printer again.

    Please let me know if this solves the problem, I am eager to see this solved and you get printing and scanning of your own computer.

  • How to use the @accum function in the calculation script

    Dear all.

    I'm new in essbase - calculation script so don't know how to use the @accum function.

    I want the aggregation value of child to parent

    Hierarchy

    Product

    100 > Storage Dimensions marked as stored (marked as intentionally as I want to calculate the value using the calculation script)

    100. 10 (+)

    100-20 (+)

    100-30 (+)

    I'm trying calculation Script

    100 = @Accum (@children("100"), jan: Feb);

    It works when I use below

    100 = @Accum("100-10",Jan:Feb);

    Error:-number of Dimensions [1] does not match number of gen/lev [3] office [@Dim]

    Don't know how I can roll up to an aggregate value of all the members of the child to the parent.

    Error.PNGhierachy.PNG

    you do this more difficult it must be. If you want to accumulate up to 100 then you could just make your calc

    '100 '.

    but that would be only 100, to make the OU any dimension would

    AGG (Product);

    Or better yet

    AGG (Product, Market);

Maybe you are looking for

  • iMovie on her very sweet voice

    Hello I add a voice-over to my movie, I made in iMovie.I use a tieclip microphone (TCM141). In the meter, I see the signal is there, but the volume is very low.The volume in the application is set to 100% and in the settings system also 100%.The micr

  • join a new existing email

    I created a new message so I could join an email I had already received. I'm not finding such a function in the logic (for me anyway) of places to check: join tools command, right-click on existing position to attach to new mail from command. Thank y

  • Impossible to watch videos using silverlight screen freezes

    Original title: why Microsoft Silverlight always freezes up my laptop if I try to watch a video? And what can I do about it? I guess Microsoft Silverlight must have something to do with the video, because whenever I try to watch a video on my laptop

  • WRT54G is not compatible with Windows Vista?

    When I used to have Windows XP, I found connection to the router is simple and reliable.  However I just got a new computer with Windows Vista and for some reason that I can't seem to install the router in addition.  I tried to insert the CD of Links

  • error device 80070052 received when you try to use USB on Vista

    I tried to transfer documents from my PC to my USB, but rode with erorr 0 x 80070052. What is - this and how to fix it?