Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

ASCII in regex

by toadi (Chaplain)
on Aug 22, 2000 at 13:18 UTC ( [id://28984]=perlquestion: print w/replies, xml ) Need Help??

toadi has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
got in my database tekst stored with newlines. When I display them in my html there is a newline. But is it possible to replace this regex with a
in a regex ???

--
My opinions may have changed,
but not the fact that I am right

Replies are listed 'Best First'.
Re: ASCII in regex
by davorg (Chancellor) on Aug 22, 2000 at 13:26 UTC

    You need to escape the <BR> tags in your post, otherwise they don't get displayed. Replace the opening < with &lt;.

    As for your question, you should be able to do something like:

    $text =~ s/\n/<BR>/g;
    --
    <http://www.dave.org.uk>

    European Perl Conference - Sept 22/24 2000, ICA, London
    <http://www.yapc.org/Europe/>
Re: ASCII in regex
by le (Friar) on Aug 22, 2000 at 13:23 UTC
    Your question is not quite clear to me, but it could be done via:
    s/\n/<br>/g;
Re: ASCII in regex
by toadi (Chaplain) on Aug 22, 2000 at 13:30 UTC
    I was to fast to press submit. I actually found it myself.
    --
    My opinions may have changed,
    but not the fact that I am right

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found