#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    sydeny nsw aus
    Posts
    53
    Rep Power
    15
    Hi guys,

    is there any one around tell me how to make two carriage return become html break line tags in the text file?

    I couldn't figure it out, please help

    thanks in advance
  2. #2
  3. No Profile Picture
    RyanP
    Guest
    Devshed Newbie (0 - 499 posts)
    $var =~ s/n{2}/<br><br>/g;
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2000
    Location
    Indiana
    Posts
    614
    Rep Power
    16
    Actually, this page line breaks, not carriage returns:

    $var =~ s/r//g;
    $var =~ s/n/<br>/g;

    that will replace returns (when the press Enter) with nothing, and line breaks with <br>'s.. not matter now many line breaks there are.

    [This message has been edited by JonLed (edited August 30, 2000).]
  6. #4
  7. No Profile Picture
    RyanP
    Guest
    Devshed Newbie (0 - 499 posts)
    Jon,
    Nice catch on the carriage returns, I forgot about that. I think you might have one too many <br>s in your second RE though.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    sydeny nsw aus
    Posts
    53
    Rep Power
    15
    thanks a lot, it worked.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2000
    Location
    Indiana
    Posts
    614
    Rep Power
    16
    Yeah, you where right. Fixed now.

IMN logo majestic logo threadwatch logo seochat tools logo