Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Search and Replace

by Abigail-II (Bishop)
on Aug 27, 2003 at 09:18 UTC ( [id://286991]=note: print w/replies, xml ) Need Help??


in reply to Search and Replace

Must i use regex or is there a module to do this kind of operations?

Well, there is never a must to use a regexp. However, the question is a regexp a good way to tackle this problem cannot be answered. You don't define how your "tags" look like, you just give an example. Your example suggests that tags appear on lines of their own, are all written in full caps, don't have attributes, don't nest themselves, and are always of the open/close form (no standalone tags). Depending on the definition of how tags look like and how they can appear, regexes may or may not be the way to go.

Abigail

Replies are listed 'Best First'.
Re: Re: Search and Replace
by nofernandes (Beadle) on Aug 27, 2003 at 09:34 UTC

    The tags are precisely like that. They appear on lines of their own,are all written in full caps, don't have attributes, don't nest themselves, and are always of the open/close form.

    And i canīt include a line saying that is xml because this file is going to be read by an application that analyze the file and get the various information of it.

    So, the tags are always like that. They open and they close..no tags inside and always in separated lines.

    Thanks for your help.

    Nuno

      And i canīt include a line saying that is xml...

      Actually, if the strange line ending characters "ķ" are an artefact of you grabbing and posting the actual content of the file from e.g. Word, then you don't have to include the <?xml line. If there is no indicating of version or encoding, any XML processor will assume version "1.0" and encoding "utf-8". If the characters in your file are all US-ASCII characters (which in this example they are), you are fine.

      Liz

        The strange line characters "ķ" are just an indicator of a new line..! In the file that actually donīt show up.

        An example file is like this

        <FMS> <HEAD> ORADEV61 GL_FORMS FULL_ANALYSIS ORAFORMS50 GET_DATABLOCK_REFS </HEAD> [<OPEN_API> Server8i User1 READABLE passworduser1 </OPEN_API>] <MOD> <NOT_REANALYZED> "G:\GL_FORMS_4\gsdl.fmb" GL "G:\GL_FORMS_4\glccat.fmb" GL "G:\GL_FORMS_4\glsdcnv.fmb" "G:\GL_FORMS_4\glcovsca.fmb>" GL </NOT_REANALYZED> <EXTERNAL> </EXTERNAL> <REANALYZED> "G:\GL_FORMS_5\glsss.fmb" GL "G:\GL_FORMS_5\glcxcvat.fmb>" GL "G:\GL_FORMS_5\glcsdsnv.fmb" GL "G:\GL_FORMS_5\glcqsoa.fmb" "G:\GL_FORMS_5\glcqsdvur.fmb" "G:\GL_FORMS_5\gldeqsdf.fmb" GL "G:\GL_FORMS_5\glg xf rp.fmb" GL "G:\GL_FORMS_5\gljou.fmb.fmb" GL "G:\GL_FORMS_5\gl sou.fmb" ķ "G:\GL_FORMS_5\gl sou2.mmb.mmb" GL </REANALYZED> </MOD> </FMS>

        Thank you once again..

        Nuno

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://286991]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-29 00:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found