Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: replace string

by Utilitarian (Vicar)
on May 18, 2009 at 08:30 UTC ( #764604=note: print w/replies, xml ) Need Help??


in reply to replace string

Could you attach a sample of your source file, the regexes you have in place should work as expected, provided the characters in the file are as you expect.

Replies are listed 'Best First'.
Re^2: replace string
by sandy1028 (Sexton) on May 18, 2009 at 09:21 UTC
    How to convert XHTML entity characters to XML form
      No need, XHTML is XML
        The input is
        <b></b>Officially called <>“events,”< +/a> as "never events"
        the string should be converted to
        <b></b>Officially called <>“events,”< +/a>as "never events"
        How can I convert only such characters.

        In case anybody visits this node again, I have a guess what sandy1028 is talking about. HTML (and XHTML) define a set of named character entities such as  . Generic XML parsers will not recognize these entities because they are application specific. So he or she needs, for whatever reason, to translate XHTML-specific named character entities to their corresponding numeric character entities for use in some non-HTML XML application.

        A few years ago I had to do this myself when reformatting some good old-fashioned HTML into something that could be used in an XSLT stylesheet. Man was that a pain.

        How to encode or decode ’ to ’

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://764604]
help
Chatterbox?
[jdporter]: ok, I need a recipe for piping lines "through" an external program which is itself a filter
[jdporter]: without using a tmp file
[1nickt]: tobyink perl -MTypes::Standard= is_Int -Mstrict -wE 'say 1 if is_Int 1.0'
[jdporter]: so that I can use the existing expand unix util. Otherwise, I'll probably use Text::Tabs.
[1nickt]: pryrt I guess I don;t really care if user 42 logs on as 42.0 ... more of an academic question at this point.
[LanX]: jdporter: open PIPE,'-|' ?
[LanX]: oh you want the result line by line?
[jdporter]: ok, LanX, then what?
[jdporter]: It doesn't have to be line by line. Just "my program" "writes" to the external prog and also/then "reads" from it.
LanX open (You are not allowed to open to a command that pipes both in and out, but see IPC::Open2, IPC::Open3, and Bidirectional Communication with Another Process in perlipc for alternatives.)

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (13)
As of 2017-05-24 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?