Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

For readability...

by tedv (Pilgrim)
on Jan 15, 2001 at 23:11 UTC ( #52007=note: print w/replies, xml ) Need Help??

in reply to substitute an enter with regular expressions

Since you're putting real newline tags in, it's quite possible that other people might look at these entries. With that in mind, your substitute should keep things readable. Suppose my input looks like this:
Foo Bar Foobar

Then the actual string is "Foo\nBar\nFoobar\n". If I just ran a simple s/\n/<br>/g on the string, I'd get this output:

Clearly this would get illegible after 20 or so entries. So use a subtitute like this instead: s/\n/<br>\n/g
Your output should look like this:
Foo<BR> Bar<BR> Foobar<BR>


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2016-10-25 03:27 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (313 votes). Check out past polls.