Replace a substring inside a string, problem

Hi
I've a little and simple problem but I couldn't found a solution.
My program is reading a file by lines, sometimes it receives a line like:
03-05-26                                               Page: 1and that reprensents a date when doc was generated (left of line) and the page number (right of line). Sometimes, before date it receive an strange char (I guess it's a \r or a \n).
Well I need to convert date from this US style to ES style (dd-MM-yy format) and then print the line as it was received.
I know how to change date, but I've problems to parse this line and get an identical line after the process. I'm using split to split tokens and then change the date but when I try to print the line again, I noticed that I lose white spaces between date and page number.
Also I probed with StringTokenizer with same results.
I use to program with PHP and there is a strreplace function to do this job easy. How could I do the same with Java ?
Thanks in advance
<jl>

Take a look at String.replaceAll and
String.replaceFirst. These use regular expression to
do their pattern matching. They're 1.4 and later
methods.Thanks.
I really dont know why I didn't saw it before ask :)
<jl>

Similar Messages

  • Replace complete words by another string

    Hi,
    I'm searching for a possibility to replace complete words inside a string.
    For example I want to replace "quick" by "slow":
    "The <b>quick</b> brown fox is running quicker then the slow brown fox".
    The result shall be:
    "The <b>slow</b> brown fox is running quicker then the slow brown fox".
    The problem is, that the built in "Replace"-Method would also replace "quicker" by "browner".
    Furthermore, words beetween different signs (e.g. , . ; : - ! " ? ') shall also be found as complete word.
    I already searched for a FM but didn't find anything. Regular expressesions are also not possible because we are running on 6.40.
    Maybe anybody can help me with a simple FM or something else.
    Best regards,
    Stefan

    Hi Stefan,
    There is a crude way of doing this....with lots of loops..
    You can use the SPLIT statement
    SPLIT dobj AT sep INTO
          { {result1 result2 ...} | {TABLE result_tab} }
          [IN {CHARACTER|BYTE} MODE].
    and break the sentence into words using space as delimiter. Once you have all the words in a internal table, you can loop through it and compare each word with the word you want.
    This will solve the problem, but will not be performant enough.
    Regards,
    Vinodh

  • Substring Location in String

    I am having a problem using substring to select/filter.  The substring selection is not holding to the specified locations in the string.  Instead, it finds any matching text in the entire string.
    For reference, my web site intent is,
    1. A single XML master data base contains all photographs for display.  My XML data set does not have quotes.
    2. Spry tabbed panels are used to select galleries (Spry regions) (e.g. roses, Big Sur Coast, etc) from the master data base.  There are a dozen galleries.
    3. Thumbnails of a gallery are displayed in the content panel.
    4. Selecting a thumbnail displays a large view of the selected photo in a separate div (Spry detail region).
    The galleries are filtered using spry:test, with the "subject" variable compared against a specified value (i.e. rose, Monterey, Salinas, etc.).
    The "2010 Photographs" gallery is determined by the year of the photo.  In the "name" variable, the first 6 digits are the date (month, day, year).  I've set up the spry:test with substring as follows,
    spry:test="'substring({name},5,2)'.search ('10 ') != -1;"
    This is to obtain the 5th and 6th locations of "name" variable and compare it with the "10 ".
    A sample of the "photo" node follows,
    <photo>
    <name>032010 Lover's Pt, Pacific Grove 02a web.jpg</name>
    <width>599</width>
    <height>400</height>
    <thumbname>032010 Lover's Pt, Pacific Grove 02a thumbnail.jpg.</thumbname>
    <thumbwidth>150</thumbwidth>
    <thumbheight>100</thumbheight>
    <subject>night</subject>
    <description>West side of Lover's Point, Pacific Grove, Ca.; the surf was unusually calm.  The glow reflecting on the clouds and the bay is from the town of Santa Cruz.</description>
    </photo>
    <photo>
    <name>090609 Pelican over Pacific Grove 02a 8x10 web.jpg</name>
    <width>500</width>
    <height>400</height>
    <thumbname>090609 Pelican over Pacific Grove 02a 8x10 thumbnail.jpg</thumbname>
    <thumbwidth>125</thumbwidth>
    <thumbheight>100</thumbheight>
    <subject>animal</subject>
    <description>Pelican caught in flight; using a flash, this photograph was taken at dusk; Pacific Grove, Ca.</description>
    </photo>
    Both of these nodes would be selected with the "10 " criteria.  However the second one is not from the year 2010.
    The full source code is shown below.
    My search of these forums and the Internet have indicated that this should work.  Please explain what I am missing or doing incorrectly in the code.
    I thank you.
    Scott
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>EnvisionMoore</title>
    <style type="text/css">
    <!--
    body {
    background-color: #FFF;
    text-align: center;
    margin: 0px;
    padding: 0px;
    #wrapper {
    width: 98%;
    margin-top: 10px;
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
    border: 0px dashed #F0F;
    position: absolute;
    left: 1px;
    top: 1px;
    height: 825px;
    background-color: #FFE4CA;
    #leftColumn {
    float: left;
    height: 700px;
    width: 400px;
    position: relative;
    left: 0px;
    top: 0px;
    #header {
    height: 125px;
    font-size: 24px;
    font-style: italic;
    vertical-align: bottom;
    padding: 0px;
    text-align: center;
    float: right;
    width: 50%;
    border: 0px solid #F00;
    position: relative;
    top: 0px;
    right: 0px;
    #selectedPhoto {
    height: 600px;
    font-size: 24px;
    font-style: italic;
    vertical-align: middle;
    padding: 0px;
    text-align: center;
    margin-top: 135px;
    width: 650px;
    border: 0px solid #0F0;
    position: absolute;
    right: -1px;
    bottom: 1px;
    -->
    </style>
    <script src="SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    var name;
    var width;
    var height;
    var thumbname;
    var thumbwidth;
    var thumbheight;
    var subject;
    var description;
    var thumbnail;
    var dsphoto;
    var dsdata;
    //-->
    </script>
    <script type="text/javascript">
    var dsdata = new Spry.Data.XMLDataSet("EM_photo.xml", "/gallery");
    var dsphoto = new Spry.Data.XMLDataSet("EM_photo.xml", "gallery/photos/photo");
    </script>
    <script type="text/javascript">
    function MM_callJS(jsStr) { //v2.0
      return eval(jsStr)
    </script>
    <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
      <div id="leftColumn">
        <div id="TabbedPanels1" class="TabbedPanels">
          <ul class="TabbedPanelsTabGroup">
            <li class="TabbedPanelsTab" tabindex="0">Welcome</li>
            <li class="TabbedPanelsTab" tabindex="0">Mechanical Engineering</li>
            <li class="TabbedPanelsTab" tabindex="0">Photography</li>
          </ul>
          <div class="TabbedPanelsContentGroup">
            <div class="TabbedPanelsContent">
              <h1><br />
      <br />
      <br />
      <br />Welcome!
      <br />
              </h1>
            </div>
            <div class="TabbedPanelsContent">Mechanical Engineering - Content 2</div>
            <div class="TabbedPanelsContent"> <!-- Photography - Content 3 -->
              <div id="TabbedPanels2" class="TabbedPanels">
                <ul class="TabbedPanelsTabGroup">
                  <li class="TabbedPanelsTab" tabindex="0">2010 Photographs</li>
                  <li class="TabbedPanelsTab" tabindex="0">Roses</li>
                  <li class="TabbedPanelsTab" tabindex="0">Calla Lilies</li>
                  <li class="TabbedPanelsTab" tabindex="0">Other Blossoms and Leaves</li>
                  <li class="TabbedPanelsTab" tabindex="0">Pacific Grove Beach</li>
                  <li class="TabbedPanelsTab" tabindex="0">Monterey Harbor and Beach</li>
                  <li class="TabbedPanelsTab" tabindex="0">Big Sur Coast</li>
                  <li class="TabbedPanelsTab" tabindex="0">Salinas Valley</li>
                  <li class="TabbedPanelsTab" tabindex="0">Animals</li>
                  <li class="TabbedPanelsTab" tabindex="0">Night</li>
                  <li class="TabbedPanelsTab" tabindex="0">Church</li>
                  <li class="TabbedPanelsTab" tabindex="0">Other</li>
                </ul>
                <div class="TabbedPanelsContentGroup-2">
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'substring({name},5,2)'.search ('10 ') != -1;" ; onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat = "dsphoto" spry:test="'{subject}'.search (/rose/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/callalily/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = "{thumbwidth}px" height = "{thumbheight}px" onclick="dsphoto.setCurrentRow('{ds_RowID}');" spry:repeat="dsphoto" spry:test="'{subject}'.search (/blossom/) !=-1;" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = "{thumbwidth}px" height = "{thumbheight}px" onclick="dsphoto.setCurrentRow('{ds_RowID}');" spry:repeat = "dsphoto" spry:test="'{subject}'.search (/^p/) !=-1;" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/Monterey/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/bigsurcoast/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/Salinas/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/animal/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/night/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/church/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                  <div class="TabbedPanelsContent-2">
                    <div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/other/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
                  </div>
                </div>
              </div>
            </div>
            <!-- End "Photography Content 3" Tabbed Panels Content. -->
          </div>
        </div>
      </div><!-- End div "leftColumn" -->
      <div id="header">
        <p>Envision Moore</p>
        <p>      Mechanical Engineering and Photography</p>
        <p>      Scott W. Moore</p>
      </div><!-- End div "header". -->
      <div id="selectedPhoto">
      <div id="Selection" spry:detailregion = "dsphoto dsdata"  >
    <!-- Selected photographs are 400px tall. -->
    <img src="Photo-Email/{name}" width = {width}px height = {height}px align="center" />
      <br />
    Description<br /><br />
    <p> {dsphoto::email/base}{description} </p>
    </div>
    </div> <!-- End div "selectedPhoto". -->
    </div> <!-- End div "wrapper" -->
    <script type="text/javascript">
    <!--
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanels2");
    //-->
    </script>
    </body>
    </html>

    Moore6931 wrote:
    Ben
    I thank you but the change of the starting location did not correct the problem.  I copied your script and pasted it into the source code but the results were the same set of thumbnails; several of the thumbnails are prior to (20)10.
    In considering the results, I decided to try,
    spry:test="'{name}'.search  ('10 ') != -1;"
    This filter gave the same result as,
    spry:test="'substring({name},4,2)'.search  ('10 ') != -1;"
    I found out that the "4,2" arguments of substring should be "4,6".  Each of these arguments are locations; other substring functions have location and length.
    I updated the filter to,
    spry:test="'substring({name},4,6)'.search  ('10') != -1;"
    The filter result was not changed.  Are the location arguments being ignored or overwritten by a default setting?  The symptom is that the first location is "0" and the second location is omitted.
    I thank you for your help.  This is rather fascinating!
    Scott
    Howdy,
    When you take a closer look at your at your code you will notice that you actually wrapped the substring function inside a string. So you are actually performing a search on:
    'substring(contents,4,6)'
    So what i would suggest is to do:
    spry:test="'{name}'.substring( 4,6 ).search( '10' ) != -1 "
    And if that doesn't work, try to use a function::syntax instead, see API: function::<function name>

  • Number of occurence of substring in a string ?.

    Hi,
    Are there any direct functions available in oracle to count the occurence of a substring in a main string. instr function gives only the position. for e.g: We wanted to count the number of "." in a string
    "oracle.co.in" . It should return 2.
    Any thoughts ?
    With thanks in advance
    Ranjeesh

    Purushotham:
    You are right about the casewhen the string and the substring are the same, the query will return NULL. However, it will return 0 if the substring is not in the string. The NVL version would be:
    NVL((Length(string) - length(replace(string, substring, null)))/length(substring),1);The other consideration is whether you want this case sensitive or not. or case insensitivity, you will need to user UPPER or LOWER on both string and substr inside the REPLACE function.
    John

  • How to replace escape characters in a string ?

    Hi All,
    In my application I came across a problem where I want to replace a substring (contains escape characters also) with another string. The below shown code will replicate my problem :
    public class StringSearchAndReplace {
      public static void main(String args[])   {
        String stmt = " \\pntext\\bullet\\tab The question as to ";
        String newStmt = stmt.replaceAll("\\bullet\\tab",  "B");
        System.out.println("BEFORE: " + stmt + "\n");
        System.out.println("AFTER: " + newStmt);
    }Here I want to replace "\\bullet\\tab" with "B". I am unable to move further. Please help/suggest me in this regard.
    Its urgent.
    Thanks in advance.

    Satyaprasad_Mylavarapu wrote:
    Hi All,
    In my application I came across a problem where I want to replace a substring (contains escape characters also) with another string. The below shown code will replicate my problem :
    public class StringSearchAndReplace {
    public static void main(String args[])   {
    String stmt = " \\pntext\\bullet\\tab The question as to ";
    String newStmt = stmt.replaceAll("\\bullet\\tab",  "B");
    System.out.println("BEFORE: " + stmt + "\n");
    System.out.println("AFTER: " + newStmt);
    }Here I want to replace "\\bullet\\tab" with "B". I am unable to move further. Please help/suggest me in this regard.
    Its urgent.
    Thanks in advance.If the String you're trying to replace contains a slash you need four slashes (double it for java, then again because String.replaceAll takes a regular expression)
    So I think what you're looking for is:
    String newStmt = stmt.replaceAll("\\\\bullet\\\\tab",  "B");I haven't tested that though.

  • Searching inside a String

    Hi,
    Can anyone tell me what's the best way to search something inside a String?
    My problem exactly:
    I have to read a sent message and seach for the "To:" substring, in order to identify the user id that follows. I think this can be achieved with a Matcher, but I don't understand how it works. Van anyone give me an example?
    Thanks

    String string = "Madam, I am Adam";
        // Starts with
        boolean  b = string.startsWith("Mad");  // true
        // Ends with
        b = string.endsWith("dam");             // true
        // Anywhere
        b = string.indexOf("I am") > 0;         // true
        // To ignore case, regular expressions must be used
        // Starts with
        b = string.matches("(?i)mad.*");
        // Ends with
        b = string.matches("(?i).*adam");
        // Anywhere
        b = string.matches("(?i).*i am.*");

  • Error 5 occurred at Open/Create/Replace File in Write spreadsheet String.vi

    Hi everyone,
    can anyone help me with this problem?
    "error 5 occurred at Open/Create/Replace File in Write spreadsheet String.vi "
    I've been using this part of the program for over a year an suddenly this error occures. But not always, mainly at the very beginning of my tests when the file should not be open.
    Info: I'm using a realtime PXI-System. Maybe the amount of data can cause the problem? (about 2MB)
    Grüße
    Meike
    Attachments:
    writeResults.jpg ‏345 KB
    error5.jpg ‏52 KB

    Hi Meike,
    is the file opened by a different program? Do you try to access it by FTP in parallel to your VI?
    You could use basic file functions instead of WriteSpreadsheetFile. That way you could open the file before starting the loop, keep it open all the time and close it once you're finished - with the added benefit of easier error handling…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Manipulating single characters inside a string?

    Hello CF Experts,
    I feel a little stupid having to ask this, but I might be suffering from mental block:
    I need to manipulate single characters inside a string. Lets say I have a string "-----" (5 hyphens) and
    I want to replace the hyphen at position #pos# with "X".
    I tried using the Mid() function, but that apparently is read-only:
         <cfset Mid(string,#pos#,1) = "X">   
    results in an error.
    Of course I can do string concatenation like
         <cfset string = Mid(string,1,#pos#-1) & "X" & Mid(string,#pos#+1,Len(string)-#pos#)
    or use the Insert/RemoveChars functions:
         <cfset string = Insert("X",string,#pos#-1)>
         <cfset string = RemoveChars(string,#pos#+1,1)>
    but this seems awfully awkward.
    There must be a more elegant solution. Any hints?
    Regards, Richard

    Strings are immutable, so one can't "edit" one, all one can do is create a new one based on an existing one.  So your insert() / removechars() approach is fine.  Or one could use left() & mid() (or right()), or replace() or... all variations on a fairly similar theme.
    (http://en.wikipedia.org/wiki/Immutable_object#Java)
    Adam

  • Replace multiple whitespaces in a string with single one

    Hi,
    I'm using Oracle 9.2.0 and I have a query on string manipulation.
    Can I replace multiple whitespaces within a string with single one. I tried with regexp_replace function but it is not supporting Oracle 9i.
    Can someone help me out?
    Regards,
    Pramod

    Just playing around:
    WITH
         Strings
    AS
          SELECT 'Can  I   replace      multiple  whitespaces   within    a     string    with single one' Text FROM Dual
    SELECT
         REPLACE
          REPLACE
           XMLAGG
            XMLElement
             "A",
             SubStr(Text, Level, 1)
           '</A>'
          '<A>'
         ) Text
    FROM
         Strings
    WHERE
         NOT
              Level > 1
          AND     SubStr(Text, Level, 1)          = ' '
          AND     SubStr(Text, Level - 1, 1)     = ' '
    CONNECT BY
         Level <= LENGTH(Text);

  • How to get First Occurnece of SubString from any string using SharePoint Designer Workflow in SharePoint Online 2013(Office 365)

    Hello All,
    I am facing Problem in SharePoint Designer Workflow. The Problem is that while replacing some subtstring with Space from a string which contains item like {Test, Test, Test, Test}, It replaces all items.
    Below two line we are using in Workflow.
    Can any body suggest some soultion for Finding first ouucrence of ", " so that we can replace only first value from string not all. When String values are different then getting proper values but if String values are same with comma
    seperated then it replace all values.
    Please some body help and your help will be heighly appriciable.
    Thanks in Advance.
    Thanks,
    Vivek Kumar Pandey   

    Have you tried to use Regular Expressions instead of Replace?
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • XML structure inside WS string response

    Hi all,
    I have a PI scenario and I can find a solution.
    The scenario is a ABAP PROXY that consume a WS, this is no problem, the problem is that the web service returns a string parameter, and inside the string parameter there is a XML structure.
    My doubt is, how can mapping it to get the response in a structured data type instead of a string??
    Thanks a lot
    Raú

    Hi ,
            Is the return type is an XML structure? Then use java mapping using DOM parser to extract the string from response. Then the mapping program can generate the required target structure from the string. 
    you can if possible let the forum members know, the response xml message and the structure of target XML as per your requirement. Finally also the version of PI you are working is also important as java mapping procedure is different for PI7.0 and PI 7.1.
    As Stefan has pointed out without java mapping it will be almost impossible to extract the target XML from String. Still you can try  out with XSLT mapping, but I don't think that will be easy task to do. Java mapping is the correct procedure to solve your problem. Finally forum members will be able to assist you if you provide complete source and target XML structure alog with  sample string response. you can reuse java mapping code for multiple interfaces within same SWCV. The part or module which will be calling the common code with different input parameters will vary accross interfaces depending on your need.
    regards
    Anupam
    Edited by: anupamsap on Sep 29, 2011 1:55 PM
    Edited by: anupamsap on Sep 29, 2011 2:21 PM

  • Replacing a character in a string to another character

    hi,
    i need to write a function or procedure to replace the character of a string value suppose:
    l_error:= 'abcdefghijklmnop' is a string
    i need write a function or procedure to replace the character "c" to "z"
    that data in l_error is not in any table.
    thanks,
    AJ

    I want to Replace all the Existence of the word - "Test" in a string with "Test1" whereever a space exits before the word Test and someother alphabet after "Test" i.e. Test will be replaced with Test1 if a word starts with Test and contains more alphabets also. For example - TestName should be replaced with Test1Name while MyTest should not be updated to MyTest1.
    I have tried to use below query which uses oracle regular expressions -
    SELECT REGEXP_REPLACE('MYCOMPANY TEST TESTGEET INDIA PVT LTD TEST','\s(TEST)\w',' TEST1') FROM DUAL
    Output -
    "MYCOMPANY TEST *TEST1EET* INDIA PVT LTD TEST"
    Here, it has also replaced the G also from TESTGEET and resulted in TEST1EET while i want TEST1GEET.
    Can someone please suggest how can i do this..... may b m doing some silly mistake but sorry m a newbie to regular expression...
    Thanks in advance..

  • Iphone is dead, gone  to insurance co. for replacement. They say because "Find My iPhone" is still active, they can't replace or try to fix it. problem is can't log in to de-activate it, cos email account does not exist anymore. How can I de-activate it?

    iphone is dead, gone  to insurance co. for replacement. They say because "Find My iPhone" is still active, they can't replace or try to fix it. problem is can't log in to de-activate it, cos email account does not exist anymore. How can I de-activate it?

    You never used your iPhone?
    You never logged into iTunes?
    Your AppleID & Password for iCloud&  iPhone should be the same AppleID &Password you used to log in here and post a message.
    -> Find your Apple ID

  • How to replace a character in a string with blank space.

    Hi,
    How to replace a character in a string with blank space.
    Note:
    I have to change string  CL_DS_1===========CM01 to CL_DS_1               CM01.
    i.e) I have to replace '=' with ' '.
    I have already tried with <b>REPLACE ALL OCCURRENCES OF '=' IN temp_fill_string WITH ' '</b>
    Its not working.

    Hi,
    Try with this..
    call method textedit- >replace_all
      exporting
        case_sensitive_mode = case_sensitive_mode
        replace_string = replace_string
        search_string = search_string
        whole_word_mode = whole_word_mode
      changing
        counter = counter
      exceptions
        error_cntl_call_method = 1
        invalid_parameter = 2.
    <b>Parameters</b>      <b> Description</b>    <b> Possible values</b>
    case_sensitive_mode    Upper-/lowercase       false Do not observe (default value)
                                                                       true  Observe
    replace_string                Text to replace the 
                                         occurrences of
                                         SEARCH_STRING
    search_string                 Text to be replaced
    whole_word_mode          Only replace whole words   false Find whole words and                                                                               
    parts of words (default                                                                               
    value)
                                                                               true  Only find whole words
    counter                         Return value specifying how
                                        many times the search string
                                        was replaced
    Regards,
      Jayaram...

  • How to replace a substring that starts with and end with another substring?

    Hi,
    I am trying to parse data from HTML tables. First I want to remove all useless tags like <font>. Now, how can I remove substrings like-
    *<font face="Verdana, Arial, Helvetica, sans-serif" size="1">My_Data_to_parse</font>*
    I was searching for any method which replaces a substring what starts with a substring (in this case "<font") and ends with another substring (in this case ">") . Is there any method like that? Or any better solution?
    Another situation like the following-
    *<td align="left" height="30" width="100%">*
    In this case I want to remove all the height, align , width etc and make it as simple as "<td>". How can I do that?
    Finally, all I am trying to do just to parse data from the tables in a html file. Is there any parser API or library to help me do that? Or to bring the data down to array from the tables based on table structure? Please suggest me.
    Thanks in advance.

    probably the best place to start is to search for the "<keyword" of all of the html keywords, then search for the location of the next ">" - this will indicate the end of the <keyword> opening tag.

Maybe you are looking for