REGEXP_REPLACE - Exclude ONLY zeros if there is between a character and numeric value [1-9]

Hi all

I need your help in providing me the regular expression to exclude zeros only if it sits between the characters and a nonzero numerical value.

For example:

PL032 = > PL32

GDP500 = > GDP500 (should remain is that the zeros are not between a character and not null)

SOA008 = > SOA8

GDP000 = > GDP0 (only exception: If that's all the 000 and then convert it 0)

Thank you for your help in advance.

Kind regards

Emeline

Hi, emeline,

1000877 wrote:

Hi all

I need your help in providing me the regular expression to exclude zeros only if it sits between the characters and a nonzero numerical value.

For example:

-ONLINE PL32 PL032

GDP500-online GDP500 (expected to remain is that the zeros are not between a character and not null)

SOA008-ONLINE SOA8

GDP000 => GDP0 (only exception: If that's all the 000 and then convert it 0)

Are characters.  When you say "between characters and numeric value", do you mean "between non-numeric characters and numeric characters?

If so:

REGEXP_REPLACE (str,

'(\D)0+(\d)'

, « \1\2 »

)

\D (with a capital D) means any non-digit character.

\d (with a small d) means any numeric characters, including 0.  Because regular expressions are greedy by default, "0 + 'match all ' 0' if some other number follows, but leave the last '0' (as you want) then there is not another number immediately after him."

Tags: Database

Similar Questions

  • Spacing between the label and the value

    I hope it is a simple guy.

    Does anyone know how to increase the space between the LABEL of the element and the value of the ELEMENT.

    Any help much appreciated.

    Hello

    Are your right-aligned labels?

    If so, use instead the following:

    style="padding-right:10px"
    

    This allows to insert a gap of 10px between the end of the label and the end of the cell

    Andy

  • Is there compatibility between InDesign CC and CC InDesign educational problems?

    I have a subscription to creative cloud and have updated all possible applications requiring an update.

    My version of InDesign is currently 9.2.2. I got a teaching InDesign from a creative cloud user file and when I try to open the file "created with a version more recent 10.0 ' I had thought of all the subscriptions of CC were equal and provide the latest version."

    Are there know educational between CC and CC compatibility problems?

    CC2014 is a new application that you will need to download and install.

  • most unique separator between the key and the value.

    Hello

    I need to write some implementation of a key delimiter value, while demand will insert this value and the delimiter that is not defined in the db.

    After that, I need to retrieve the key and the value, the question that this delimiter is defined by a custom code and it might be something.

    My problem starts when the delimiter that defined by custom code will be part of the 'key' or\and 'value '. in this case, the index of the key and value of the analysis or split or any regex-based will give the wrong key and value.

    Please advice, what is your suggestion for m searching the Internet to find any piece of information that can help.

    Thanks in advance.

    These examples are not relevant if your use case is not the same thing as what this code is from.

    1. you now have the rules.

    2. you have Java class files that implement these rules for a defined set of data types and work delimiters

    3. you have the Java source code for these class files so you can see exactly how the rules are applied and how specific types of data, and the delimiters affect the process.

    It is up to YOU to determine if the existing code will do what you need and, if not, to change this code (or write your own) that implements the rules for your use case.

    You have all the information you need to do the work. Nobody on the forum, and certainly not me, is going to write your code for you. If you can't do the job when you have ALL the necessary information then you will need to hire a consultant to do.

    Any other help is possible.

  • SQL Native Performance difference between coded hard and parameter value

    Hello

    I have a SQL query (Oracle) native (quite long and complex with many subqueries) which returns in less than a second in ODSI and using an external SQL tool. This query contains a hardcoded for a particular, namely column value, a date column.
    When I change the function ODSI signature so that I have pass a parameter, and then replace the hardcoded value in the native SQL with the appropriate parameter binding notation (i.e. '?'), the query takes much longer (2-30 seconds). The duration of the query depends on how many records is returned, so he must execute a separate query for each of the outcomes (i.e. most returned results, longer the query takes to return).
    What can I do to maintain the duration of my low ODSI request while allowing the setting?

    Thank you. Try the oracle.jdbc.OracleDriver in WLS/ODSI, let know us.

  • Show(); -> Differences between the element and symbol?

    Hello

    I can't ged rid of a problem of confusion.

    I have a symbol (mySym) on my scene. the initial state is hidden.

    If I give the word:

    SYM.$('mySym'). Show();

    nothing happens. If I do the same spirit a component on the stage:

    SYM.$('myElement'). Show();

    It works well. If I use

    sym.getSymbol)

    This is the same behavior. Are there differences between a symbol and an element?

    I didn't? Or?

    Thanks for the help,

    Michael

    Solved the Riddle by myself. I'll leave the answer to others:

    There is no difference! It worked fine, but I have an animation in my symbol and triggered incorrectly.

    I tried with:

    SYM.$('mySym'). Play();

    and it has not worked for play();

    I have to use:

    sym.getSymbol('mySym').play ();

    to trigger the chronology. Now, everything's fine.

    Thanks to myself for the answer. ;-)

    And thanks to this forum which has answered a lot of Questions yet.

    Cheers - M.

  • How to hide a column in the report when there are only zeros.

    Hi Experts.,.

    Is it possible to hide a column in the report when there are only zeros.

    Thanks in advance
    Vincent

    Vincent Krishna wrote:
    Hi Experts.,.

    Is it possible to hide a column in the report when there are only zeros.

    Thanks in advance
    Vincent

    No out-of-the-box, but there are several workaround solutions if you want to continue an any of them:

    (1) use a view selector. A single report will be a pivot table with the column, the other will have the same report less column. Users can switch reports.

    (2) use a column selector. The two choices would be this column or an empty space. If white is chosen (because the user has no values), the column "will disappear" according to the report.

    (3) guided use NAV. This method involves the intervention of the user. Build a small report using the single column and put a filter "is not equal to" 0. Because there is only a single column, so all lines are 0, the report returns no rows.

    Use this report in the properties of guided navigation from one section of the dashboard. Assign to this "If the report returns lines" and put the report that contains the column in this section. Now add another article on your table edge and in the properties of guided navigation of this section, set on "If the report will return no rows" and it points to the small report as well. In this section, put a second version of your report without the column in it.

    When the column contains all zeros, the second section with column will not display in it; the first section is not displayed. When at least a line contains a value not zero, the first section is displayed with the column, and the second part will not be.

  • NB200 - only little difference in speed between the modules of RAM?

    Hello everyone,

    Recently installed Windows 7 on my NB200 and thought I would setup an extra RAM.

    The RAM only I could get, was 2 GB of 667 MHz, as opposed to the 800 MHz supplied with the NB200. I thought that double the RAM would more than offset the slight difference in mhz between the new and old Rams.

    As I understand it, it's only little practice speed difference of real world, between the 667 MHz and 800 MHz RAM, is - this correct?

    Also: The 2 GB of RAM, I had had twice the amount of chips on the RAM slot than the old. Should I be concerned? I'm worried that doubles the amount of chips in a little place could lead to problems of heat/cooling... Any opinions?

    Thank you!

    There is no much difference between 667 and 800, in fact, I think the CPU at 667 anyway, but 800 races comes because of the limited availability of 667 RAM.

    Cooling should not be a problem if the RAM uses the same calendar and turn at the same voltage as the original of the RAM.

  • Are there differences between Windows 7 OEM and the commercial full version?

    Are there differences between Windows 7 OEM and the commercial full version?

    Commercial versions include two disks installing 32 and 64 bits and can be moved to new systems.

    OEM versions are either 32 or 64-bit - only installation disc is included - and cannot be moved to a new system.

  • Is there a way to sync between my table and my phone? I don't want to have my office involved.

    I would like to sync between my Tablet and phone. I don't want to share with the office. Is there a way to do this?

    Hi, you will need to create a sync account on the desktop, but does not synchronize the activity of browsers. After having a key synchronization you can use it between your devices.

  • Is there a way to differentiate between a conference and music?

    Is there a way to differentiate between a conference and music on my I Pod Touch?

    By the title/subject.

    In iTunes, you can change the media type between;

    -Music; goes in the music app

    -Podcast, go to podcast app

    -iTunes U

    -Audio book, and

    -Voice memo

  • I have an iMac (2015).  When I open Garageband, there are only two buttons on the control bar, play and stop.  No record button, rewind or ff.  Where are they and how can I make it appear?

    I have an iMac (2015). When I open Garageband, there are only two buttons on the control bar, play and stop. No record button, rewind or ff. Where are they and how can I make it appear?

    Try to enlarge the GarageBand window by dragging the corners of resizing.

    If she looks like this, your window is small:

    You can also try to click the double arrow at the end of the toolbar to reveal more options.

  • My screen iphone6 is cracked and in my country, they can only change the iphone with a new one and with a very high price. Is there anyway that I could replace just the screen?

    My screen iphone6 is cracked and in my country, they can only change the iphone with a new one and with a very high price. Is there anyway that I could replace just the screen?

    No, if you want to keep all rights to the service or support from Apple. Not to mention the fact that it then will be bork Touch ID and make the phone unusable if ever, you restore or update of iOS.

    Apple doesn't sell parts of the iPhone. There is no legitimate sources for replacement screens.

  • There are the functional differences between the trial and the full version?

    There are the functional differences between the trial and the paid version for Labview 2009?  Thank you.

    He described the Labview eval version limitations: Limitations of the Evaluation Version of LabVIEW

    See you soon,.

  • "There is a time difference between the client and the server"

    Unit 4.0.3

    Everything worked very well, and all of a sudden, I'm not able to connect to the server unit using any domain account. When I enter the domain/name username/password, I get this error message:

    ************************************************

    The system is unable to log on due to the following error:

    There is a time difference between the client and the server.

    Try again or contact your system administrator.

    **************************************************

    I can use the same domain account (unityinstall) and the journal in other machines. I can connect the machine to the unit using a local account. There is no time difference between the DC server and unity.

    Need help,

    Thank you

    Partha

    Log on to your LOCAL computer using an account that has privileges

    At the command prompt, type the following:

    NET TIME ancien_mot_passe/set

    Found this on the MS site:

    Cannot open a session if the Date and time are not synchronized

    http://support.Microsoft.com/default.aspx?scid=kb;en-us;232386&product=Win2000

Maybe you are looking for

  • You have obtained allow to Download Accelerator Plus like you used to.

    Firefox 3.6 and lower authorized DAP download AcceleratorPlus. I use it constantly and will remain with them until you get in your last one. Please make it compatible.

  • Windows 8 Upgrade for Satellite C870D-105 possible?

    Hi out there,. I own a Satellite C870D - 105 Partnumber PSCA2E.Anyone know if it is possible to upgrade my Win7 Home Premium to Windows 8 Pro via the wizard of Windows upgrade? So far I did not, and the part number does not appear in the matrix of co

  • need bigger drive

    I have an old IBM Thinkcentre 6075-a5u with a 80 MB drive - wd800jd-08msa1. Not knowing much about the different types of readers, I'm trying to exchange this drive for a bigger, as double capacity. Any ideas?

  • Equium A100-338 does not start the OS Vista - update Bios?

    Hi guys,. My laptop (a few months) decided to die and was told by tech support that it might be because of the BIOS. The problem is that the computer does not start the operating system (Vista) and the update of the BIOS available only is the version

  • Windows experience Index Crash

    I can't record my system because whenever I start my pc Windows experience index rate, the pc just shuts.I run a CPU from 3.4 Ghz 64-bit 2 GB of RAM on a GeForce 7800GTX 256 MB RAM I was able to retrieve this message from the journal of the C:\Window