Find and replace value in Delimited String

Hi All,
I have a requirement, where i need to find and replace values in delimited string.
For example, the string is "GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~". The 4th column gives month and year. I need to replace it with previous month name. For example: "GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~". I need to do same for last 12 months.
I thought of first devide the values and store it in variable and then after replacing it with required value, join it back.
I just wanted to know if there is any better way to do it?

for example (Assumption: the abbreviated month is the first occurance of 3 consecutive alphabetic charachters)
with testdata as (
select 'GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~' str from dual
select
str
,regexp_substr(str, '[[:alpha:]]{3}') part
,to_date('01'||regexp_substr(str, '[[:alpha:]]{3}')||'2013', 'DDMONYYYY') part_date
,replace (str
         ,regexp_substr(str, '[[:alpha:]]{3}')
         ,to_char(add_months(to_date('01'||regexp_substr(str, '[[:alpha:]]{3}')||'2013', 'DDMONYYYY'),-1),'MON')
) res
from testdata
STR
PART
PART_DATE
RES
GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~
FEB
02/01/2013
GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~
with year included
with testdata as (
select 'GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~' str from dual
select
str
,regexp_substr(str, '[[:alpha:]]{3}-\d{2}') part
,to_date(regexp_substr(str, '[[:alpha:]]{3}-\d{2}'), 'MON-YY') part_date
,replace (str
         ,regexp_substr(str, '[[:alpha:]]{3}-\d{2}')
         ,to_char(add_months(to_date(regexp_substr(str, '[[:alpha:]]{3}-\d{2}'), 'MON-YY'),-1),'MON-YY')
) res
from testdata
STR
PART
PART_DATE
RES
GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~
JAN-13
01/01/2013
GL~1001~157747~DEC-12~CREDIT~A~N~USD~NULL~
Message was edited by: chris227 year included

Similar Messages

  • [Forum FAQ] How to find and replace text strings in the shapes in Excel using Windows PowerShell

    Windows PowerShell is a powerful command tool and we can use it for management and operations. In this article we introduce the detailed steps to use Windows PowerShell to find and replace test string in the
    shapes in Excel Object.
    Since the Excel.Application
    is available for representing the entire Microsoft Excel application, we can invoke the relevant Properties and Methods to help us to
    interact with Excel document.
    The figure below is an excel file:
    Figure 1.
    You can use the PowerShell script below to list the text in the shapes and replace the text string to “text”:
    $text = “text1”,”text2”,”text3”,”text3”
    $Excel 
    = New-Object -ComObject Excel.Application
    $Excel.visible = $true
    $Workbook 
    = $Excel.workbooks.open("d:\shape.xlsx")      
    #Open the excel file
    $Worksheet 
    = $Workbook.Worksheets.Item("shapes")       
    #Open the worksheet named "shapes"
    $shape = $Worksheet.Shapes      
    # Get all the shapes
    $i=0      
    # This number is used to replace the text in sequence as the variable “$text”
    Foreach ($sh in $shape){
    $sh.TextFrame.Characters().text  
    # Get the textbox in the shape
    $sh.TextFrame.Characters().text = 
    $text[$i++]       
    #Change the value of the textbox in the shape one by one
    $WorkBook.Save()              
    #Save workbook in excel
    $WorkBook.Close()             
    #Close workbook in excel
    [void]$excel.quit()           
    #Quit Excel
    Before invoking the methods and properties, we can use the cmdlet “Get-Member” to list the available methods.
    Besides, we can also find the documents about these methods and properties in MSDN:
    Workbook.Worksheets Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff835542(v=office.15).aspx
    Worksheet.Shapes Property:
    http://msdn.microsoft.com/en-us/library/office/ff821817(v=office.15).aspx
    Shape.TextFrame Property:
    http://msdn.microsoft.com/en-us/library/office/ff839162(v=office.15).aspx
    TextFrame.Characters Method (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff195027(v=office.15).aspx
    Characters.Text Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff838596(v=office.15).aspx
    After running the script above, we can see the changes in the figure below:
    Figure 2.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thank you for the information, but does this thread really need to be stuck to the top of the forum?
    If there must be a sticky, I'd rather see a link to a page on the wiki that has links to all of these ForumFAQ posts.
    EDIT: I see this is no longer stuck to the top of the forum, thank you.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • How to find and replace with sequential values?

    im building a website. it contains 12 main images per page and luckily according to my design the source code per page contains 12 <img> tags only (rest is background and stuff). now for many pages i keep using a particular page as template and then change each and every image by browsing and clicking. Now i want to make my work easy.
    the images that i want to add in every page are sequentially file named.  001.jpg , 002.jpg .......... and so on.
    So is there some way that i can use find and replace , to find the <img> tags and fill them all with values sequentially that is the first <img> tag containts 001.jpg and the second containts 002,jpg and so on .
    the pages are many thats why i want to make this easy
    thanks very much for help

    Will they ever do this?   I just wish Adobe would purchase TextPad and integrate it into Dreamweaver.  In TextPad, from the manual:
    Other TextPad options in the replacement string:
    \i Generate a sequence number.
    \i(N,M) Ditto, starting at N and incrementing by M.
    So beautifully simple.

  • Find and Replace text string in HTML

    Opps... I hope this forum is not just for Outlook. My Html files reside on my hard-drive. I am looking for VBA code to open specified file names ####File.html and then find and replace text strings within the html for example "####Name" replaced
    with "YYYYY"
    I drive the "####File.html" names and the find and replace text strings from an Excel sheet. I am an artist and this Sub would give me time to paint instead of find and replace text. Thank you!
    [email protected]

    Hello Phil,
    The current forum is for developers and Outlook related programming questions. That's why I'd suggest hiring anybody for developing the code for you. You may find freelancers, for example. Try googling for any freelance-related web sites and asking such
    questions there.
    If you decide to develop an Outlook macro on your own, the
    Getting Started with VBA in Outlook 2010 article is a good place to start from.

  • Find and replace string in file

    hi,
    i need to find and replace text (string) data in about 100+ files, i've decided to write a small java program to do it but i'm stuck on how to replace.
    here is what i'm heading towards:
    class ReplaceString {
      BufferedReader in;
      BufferedReader os;
      public static void main(String args[]) {
        ReplaceString obj = new ReplaceString();
        obj.replace();
       void replace() {
         try {
           in = new BufferedReader(new FileReader("a.txt");
           os = new BufferdWriter(new FileWriter("a.txt");
           //  read until end of file
           String currentLine = new String();
           while((currenLine=is.readLine()) != null) {
             //  if matching text then replace????
             if(currentLine.equals("Version 001") {
                // how to now replace the Version 001 with Version 002???
         }catch(IOException e) {
            System.out.println(e);
            in.close();
            os.close();
         in.close();
         os.close();
    }the above code i just typed so there might be errors, but looks ok to me, is there any way once i find the string i want to replace, to replace the string with another string. basically i want to replace all occurrences of the text "Version 001" with "Version 002"
    Thank you.

    Is it always true, as in your example, that the replacement is the same length as the existing string? If so, this one's easy.
    Is it also true that you don't need to worry about 16-bit chars? (Again, as in your example.) If you're using just ASCII characters, this gets easier still.
    1) Segregate the file I/O from the search/replace process.
    2) Main becomes:
    readFile();
    replace( "this", "that" );
    writeFile();Use a byte array buffer, defined in your main class. Fill it via the readFile() code. Use a RandomAccessFile, check its length() to allocate your byte array, then do a single read() to fill the buffer.
    A brute force search will certainly work: scan for the first search character, then check the rest for a match, replace if you've got a match and continue scanning. Alternative if your file's aren't too big: create a String from the byte array:
    // buffer is a byte array
    String s = new String( buffer );And use the String.replaceAll() to do the search/replace. Recover the buffer with:
    buffer = string.getBytes();A single write() and close() should handle the remaining work.

  • How to find and replace any string between " "

    Hi everyone,
    Here my sample
    String szTest;
    szTest = "Yellow banana";
    szTest = "Blue monkey";
    szTest = "Red mango";
    szTest is only needed when it's in testing progress. Now I want to put all of that in the /*comment*/ so the released program won't run those code any more (but still keep szTest so I can use it for future develop testing).
    So Here what I want after using the Find and Replace Box:
    //String szTest; //Manual
    /*szTest = "Yellow banana";*/ //use find and replace
    /*szTest = "Blue monkey";*/ //use find and replace
    /*szTest = "Red mango";*/ //use find and replace
    I think I can do this with Regular expressions or Wildcards. But I don't know how to find and replace any string between " and ".
    Find: szTest = " ??Any string?? ";
    Replace with: /*szTest = " ??Any string?? ";*/
    Thanks for reading.

    Hi Nathan.j.Smith,
    Based on your issue, I suggest you can try the Joel's suggestion check your issue again. In addition, I find a MSDN document about how to use the Regex.Replace Method to match a regular expression pattern with a specified replacement string,
    maybe you will get some useful message.
    https://msdn.microsoft.com/en-us/library/xwewhkd1(v=vs.110).aspx
    If the above suggestion still could not provide you, could you please tell me what language you use to create the program for finding and replace any string using regular expression so that we will find the correct programming develop forum to support this
    issue?
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • String find and replace

    Hello,
    I am trying to do the equivalent of a find and replace in a String object.
    I want to be able to replace text in a String with a java variable so as an example, this is a line of the text file. The text has to be stored in an outside file and read in...
    <b><center>Users name is #username#</center></b>
    I have this String stored in, lets say, outputString and have the username stored in usernameString. I want to do something like:
    String usernameString = "bob";
    if ( //found the reference #username# in outputString ) {
         //replace #username# with usernameString;
    }So I end up with:
    <b><center>Users name is Bob</center></b>
    I have looked at the methods in String and it is possible to do this if I do a lot of complicated coding using Char[] arrays or index counts etc.
    Does anyone have any idea how to do this easily?
    Many Thanks

    Use the StringBuffer class:
    String usernameString = "bob";
    if(outputString.indexOf("#username#") > -1) {
        outputString = new StringBuffer(outputString).replace(outputString.indexOf("#username#"),
                                                                                      "#username#".length(),
                                                                                      usernameString).toString();
    }

  • Using applescript for Find and Replace All in Pages 2.0

    i saw that Pages 2.0 is scriptable
    i try to create a script for merge use to find and replace all occurence of a certain string using a script but Pages doesn't seems to respond to "Find" even using "System Events"
    how can i do to use this function with a script
    Thanx for any help
    S.B.
    ibook G3   Mac OS X (10.4.6)  

    OK, here's another example. This one gets the text as a string and uses the offset property to find "[", presuming it to be a merge delimiter. (Pages' text doesn't support "offset of").
    One failing of this scheme is that the offsets are incorrect if you have inline objects (pictures, shapes, tables, etc.). While it is probably possible to compensate for them, that's a trickier proposition.
    <PRE>-- Example merge replacements:
    property mergeText : {"[name]", "John Smith", "[address]", "1234 Anystreet"}
    on lookup(mergeWord)
    set theCount to count of mergeText
    repeat with x from 1 to theCount by 2
    if item x of mergeText = mergeWord then
    return item (x + 1) of mergeText
    end if
    end repeat
    -- If merge field is not found, delete it (replace it with the empty string)
    return ""
    end lookup
    tell application "Pages"
    repeat
    tell body text of document 1
    -- Get text as a string so that "offset of" can be used.
    set allText to it as string
    set startOffset to offset of "[" in allText
    if (startOffset = 0) then
    exit repeat
    end if
    set endOffset to offset of "]" in allText
    select (text from character startOffset to character endOffset)
    end tell
    set mergeWord to contents of selection
    tell me to lookup(mergeWord)
    set replacement to result
    set selection to replacement
    if (replacement is "") then
    -- Get rid of extra whitespace (space or return)
    -- Do it in a "try" block to handle edge cases at start or end of text.
    try
    set theSel to (get selection)
    set ch1 to character before theSel
    set ch2 to character after theSel
    if ((ch1 is " " or ch1 is return) and (ch2 is " " or ch2 is return)) then
    select character after theSel
    delete selection
    end if
    end try
    end if
    end repeat
    end tell</PRE>
    Titanium PowerBook   Mac OS X (10.4.6)  

  • Find and Replace a Blank in Load Rules

    <BR>Does anyone know if it is possible to find and replace a blank cell with a member name within Essbase Load Rules? My source data (a .txt file) has blanks within a single dimension that I need to replace with an Essbase member name so I can load it into the essbase cube. Until I add characters into the 'Find' window within Find and Replace, the option to add it in is greyed out. I am using Essbase 6.5.1<BR><BR>

    From the DBag: Replacing an Empty Field with Text <BR><BR>You may want to replace empty fields in a column with text. If, for example, empty fields in the column represent default values, you could insert the default values to replace the empty ones or insert #MI to represent missing values. <BR><BR>Replacing an empty field with text requires several steps. To replace an empty field with text: <BR><BR>Select the column containing the empty fields you want to replace. <BR><BR>Choose Field > Create Using Text or click the Create Using Text button, . <BR><BR>Enter the text to put in the new field. Enter a dummy string that is not in the selected column, such as "temp." Click OK. <BR><BR>Join the new field with the column containing the fields to replace. Select both columns, choose Field > Join, and click OK. The previously blank fields now contain the dummy string you entered in step 3; for example, temp. <BR><BR>Select the column containing the dummy string and choose Field > Properties or click the Field Properties button, . Click the Global Properties tab. <BR><BR>Enter the text string you want to replace in the Replace text box. This should be the dummy string you entered in step 3; for example, temp. Now enter the text to replace it with in the With text box. This should be the final value you want to put in the fields, for example, default. Select the Match Whole Word. <BR><BR>Click Add and then click OK. <BR><BR>Now replace the extra dummy strings in the column with nothing. Choose Field > Properties or click the Field Properties button, . Click the Global Properties tab. Enter the dummy string in the Replace text box; for example, temp. Enter nothing in the With text box. Make sure the Match Whole Word option is not checked. Click Add and then click OK.<BR>

  • Find and replace an item in one column only

    I have tried and tried and I cannot work out how to find and replace an item in one column only.
    For example one column has a letter followed by a number which varies in length.
    I want to find and repace the letters with nothing leaving the numbers only.
    But when I try to do this all the letters in the spreadheet are replaced, not just in the column I have selected.
    Help please....

    Hi 8'
    Use a formula.
    Insert a (temporary) auxiliary column to the right of the one for which you want to male the changes.
    Assuming you description is accurate—every entry in the column consists of a letter followed immediately by a number of one or more digits—the problen could also be stated as  "How do I strip the first character from a string?"
    Here's a sample. Letter followed by number in column B; number part without leading letter i column C:
    Formula:
    C2, and filled down to end of column: =RIGHT(B,LEN(B)-1)
    When the formula has done its work:
    Select all of column C (except the ehader row cell), and Copy.
    Select cell B2, and go Edit > Paste Values.
    Select column C again and go Table (menu) > Delete column.
    Regards,
    Barry

  • Find and Replace with space or tab

    Hi,
    I have a text file that has commas separating values. I saved it as a csv, but am not getting the results I need with the csv file. I'd like to replace the commas with a space or a tab.
    I know how to use find replace, but I do not know how to indicate these non-printing characters. I tried the ascii code &#32 for space, but i simply get that string of characters replacing my commas.
    ANy help?
    Thanks

    KW,
    You didn't say what program you were using for the Find and Replace, but I'd suggest that Pages would be your best bet. Spaces can be typed-in directly, and several other non-printing characters can be inserted from a drop-down menu.
    The Insert drop-down seems to be available only in Pages, as opposed to Numbers and TextEdit.
    Jerry

  • Find and replace in RTF Template

    Hi,
    I'm using a if statement in my template, but i need to change a value within this statement. It's being used multiple times, therefor it would be easier to do a find and replace, is there a way to do a find and replace within the RTF template? Already openede it in Notepad++, but no luck
    Osman

    I don't think there is a way to find and replace all.. You can view all the code by using Field Browser -> Show All and then replace the code and update one by one from there..
    Thanks,
    Bipuser

  • Dumb Q: problem with Find And Replace window in Flash 8

    Dear Flash Group,
    apologies if this is trivial, it's my first day using Flash.
    I downloaded a Flash project from
    http://www.flashorb.com/articles/benchmark_files/flash-benchmark.zip.
    This
    flash calls into a web service at localhost:8080. I used the
    'Find and
    Replace' window within Flash Professional 8 to locate the
    string
    'localhost:8080' and replaced it with plain 'localhost'.
    However, when I 'Debug the Movie' (Ctrl-Shift-Enter), it
    still tries to
    access port 8080! Obsiously, my replace command did not do
    what I thought it
    would do. I opened the FLA file in a binary editor, and saw 4
    more
    references to 8080, One if them in 'Properties' of a
    WebServicesConnector,
    but I cannot figure out how to find the other occurences.
    Checking on google, I see lots of people having similar
    problems, but no
    solutions
    Any ideas?
    Regards, /george
    PS. What do you guys do for code completion - is there a tool
    that would
    bring Flash on par with an professional IDE?

    george,
    > when I 'Debug the Movie' (Ctrl-Shift-Enter), it still
    > tries to access port 8080! Obsiously, my replace
    > command did not do what I thought it would do.
    Agreed.
    > I opened the FLA file in a binary editor, and saw 4
    > more references to 8080, One if them in 'Properties'
    > of a WebServicesConnector, but I cannot figure out
    > how to find the other occurences.
    Might they be the result of that WebServicesConnector
    reference?
    > Checking on google, I see lots of people having
    > similar problems, but no solutions
    That's really odd, actually. I'm on these boards every day,
    and I've
    never heard of this issue. I don't *think* the Find/Replace
    dialog visits
    panel contents, such as the Component Inspector panel, but I
    wouldn't swear
    to that.
    > What do you guys do for code completion - is there
    > a tool that would bring Flash on par with an
    professional IDE?
    Well, Flash is a professional IDE, of course. By definition,
    if you pay
    for something, you have acquired a professional product or
    service. I know
    what you mean, though. Flash itself rocks, but the Actions
    panel can be
    glaringly weak. Personally, I use SE|PY to edit ActionScript.
    http://www.sephiroth.it/python/sepy.php
    Sorry I can't speak to your other issue. :-/
    David
    stiller (at) quip (dot) net
    Dev essays:
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Folder action to find and replace text and change line feeds

    I want to use a folder action to find and replace text and change Mac carriage returns to DOS line feeds inside text files.
    The text to be replaced is: "/Users/wim/Music/iTunes/iTunes Music/Music" (without the quotes)
    This text has to be removed (i.e. replaced by an empty string)
    The text occurs many times within each file.
    The files are playlists exported from iTunes in the M3U format (which are text files). They contain Mac carriage returns. These need to be changed to DOS line feeds.
    I have found the following two perl commands to achieve this:
    To find and replace text: perl -pi -w -e 's/THIS/THAT/g;' *.txt
    To change carriage returns to line feeds: perl -i -pe 's/\015/\015\012/g' mac-file
    I know that it's possible to make a folder action with Automator that executes a shell script.
    What I want to do is drop the exported playlists in M3U format in a folder so that the folder action will remove the right text and change the carriage returns.
    My questions are:
    Is it possible to make a folder action that executes command line commands instead of shell scripts?
    What is the correct syntax for the two commands when used in a folder action shell script? Especially, how do I escape the slashes (/) in the string to be removed?
    Thanks for your help

    Ok, I've include an applescript to run a shell command. The applesript command quoted form makes a string that will end up as a single string on the bash command line.  Depending on what you want to do, you may need multiple string on the bash command lines.  I've included some information on folder actions.
    It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.
        Author: rccharles
        For testing, run in the Script Editor.
          1) Click on the Event Log tab to see the output from the log statement
          2) Click on Run
        For running shell commands see:
        http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        --  debug lines
        set desktopPath to (path to desktop) as string
        log "desktopPath = " & desktopPath
        set unixDesktopPath to POSIX path of desktopPath
        log "unixDesktopPath = " & unixDesktopPath
        set quotedUnixDesktopPath to quoted form of unixDesktopPath
        log "quoted form is " & quotedUnixDesktopPath
        try
            set fromUnix to do shell script "ls -l  " & quotedUnixDesktopPath
            display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
        on error errMsg
            log "ls -l error..." & errMsg
        end try
    end run
    How to set up a folder action.
    1) right click on folder. click on Enable folder actions
    2) Place script in
    /Library/Scripts/Folder Actions Scripts
    3) right click on folder. click on attach folder action
    pick your script.
    Create a new folder on the desktop & try.
    You can put multiple folder actions on a folder. There are other ways of doing this.
    Here is my test script:
    on adding folder items to this_folder after receiving dropped_items
        repeat with dropped_item_ref in dropped_items
           display dialog "dropped files is " & dropped_item_ref & " on folder " & this_folder
        end repeat
    end adding folder items to
    How to  make the text into an AppleScript program.
    Start the AppleScript Editor
    /Applications/AppleScript/Script Editor.app
    In Snow Leopard it's at: /Applications/Utilities/AppleScript Editor
    Copy the script text to the Applescript editor.
    Note: The ¬ is typed as option+return.  ption+return is the Applescript line continuation characters.
    You may need to retype these characters.
    Save the text to a file as an script and do not check any of the boxes below.

  • Find and Replace Issue Help Requested.

    Hi all. I've been digging around for a couple of days and
    can't seem to figure this one out. For starters, I have already
    looked at the Regular Expression syntax and tried the MS word
    clean-up option, but no luck. We have about 1,500 pages of content.
    They are in DNN, so the pages are created dynamically.
    Unfortunately, the page content was written in Word and then dumped
    in DNN. We are trying to clean up the pages. We are grabbing the
    content from Dot Net Nuke and putting it into Dreamweaver 8.0.2.
    Then we are manually cleaning out things like:
    <?xml:namespace prefix = o ns =
    "urn:schemas-microsoft-com:office:office" />
    and
    <P class=MsoNormal style="MARGIN: 0in 0in 0pt"
    align=left>
    We are using the Find and Replace funtion in Dreamweaver to
    clean out these commands, but I know from the documentation, there
    is an easier way to clean these pages.
    Bottom Line: Since the pages are dynamically built, I know I
    have to grab the page content and put it in Dreamweaver manually
    and then put it back in DNN, but I am trying to find a way (using
    Regular Expressions or something) to look for all the little
    variances of MSO, <?XML, etc. in a straight shot. I would like
    to find a way to use a wild card to look for all tags that have MSO
    or Microsoft or ?XML in them and then replace them with a null
    value. From what I can tell, the Find would have to use a wildcard
    because the advanced find features don't carry what I am looking
    for. Something like Find \<?xml * [<-wildcard] to \> to
    grab the entire tag. The Find tag command doesn't work because the
    tags I need aren't listed. Also, because the content is dynamic, I
    can't do a Fins and Replace against the entire site for these
    commands, but it would be nice to "Find" all of these items with a
    single pass since the "Replace" value is always null.
    The wildcard syntax and multiple Find instances are the main
    questions. The wildcards seem to be character or space specific.
    Sorry for the long explanation - I just don't want to waste
    anyone's time typing responses to things I've already tried to do.
    Thanks in advance for any help. This is my first time back in
    the forums in about 4 years.

    sadamec1 wrote:
    > Well David, you Findmaster - it worked! (At least it
    found and highlighted the
    > code). Now, I need to dig through what you sent me and
    compare it against my
    > regular expression definitions to find out how to grab
    the rest of these
    > phrases. You're the best. Thank you!
    Glad that it did the trick. Just to help you understand what
    I did,
    there are two main sections, as follows:
    <\?xml[^>]+>
    and
    <[^>]+(?=class=Mso)[^>]+>
    They are separated by a vertical pipe (|), so they simply act
    as
    alternatives.
    The first one searches for <?xml followed by anything
    except a closing
    bracket until it reaches the first closing bracket.
    The second one is more complex. It begins with this:
    <[^>]+
    This simply looks for an opening bracket followed by anything
    other than
    a closing bracket. What makes it more intelligent is the next
    bit:
    (?=class=Mso)
    This does a forward search for "class=Mso". It's then
    followed by this
    again:
    [^>]+>
    That finds anything except a closing bracket followed by a
    closing bracket.
    The bit that you need to experiment with is (?=...). It's
    technically
    called a "forward lookaround". The effect is that the second
    half of the
    regex finds <....class=Mso....>.
    David Powers
    Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    http://foundationphp.com/

Maybe you are looking for

  • Windows XP Home or Professional Service Pack 3 for my new ipod??? Why?

    Majority of all my ipod songs are on my iTunes on my old computer (which we bought in 2005), and at the time I've been using my second generation ipod. So now that I've bought a new 4th gig one...I see on the back of the case how it says that it need

  • Printing from wireless MacBook to iMac shared printer

    I have an HP PSC 2350 connected to an iMac in my office. I am using my MacBook via a Linksys router, in another room, and would like to print to the PSC 2350. The iMac and printer are turned on - but the printer does not appear on the MacBook. Someth

  • SA 520 blank logon page

    Hello. We use SA-520 appliance as front-end firewall connected to sattelite with about 15-20 users behind. Remote management is enabled. Lately have found after device is up for 2-3 days and I'm trying to login remotely I get certificate warning and

  • Starting my PowerMac G3(beige)

    Hi I'm completely new to Apple Macs, have always used PCs. Someone has just given me a PowerMac G3, just the processor. The label on the back of the box reads 266MHz 512K cache. I've got my PC monitor plugged into the box and the display is working f

  • Is it possible to return more than one field values to base form from LOV ?

    Hi I have a form with employee_number, employee_name, email_address, phone_nos...etc. I have a LOV to select employees from remote database, I want to send selected employee details to current form through LOV. Is it possible? Now I am doing like thi