[thelist] Regular Expression

Johnny Lam jlam at popcast.com
Wed Apr 25 16:15:52 CDT 2001


Josh,

Yes I am trying to read what users input on a textarea form and capture all
their input including the times they hit "Return". This way I can use what
they enter and print it out dynamically on another page. But I get errors
when I read this information with line breaks so that's why I have to find
those line breaks and replace them with "\n". I used to have this working
with ASP by using this command:

description = Replace (str_description,vbcrlf,"\n")

Now that we're moving to the JScript backend I don't have a clue how to
capture the vbcrlf.

-----Original Message-----
From: Joshua Olson [mailto:joshua at alphashop.net]
Sent: Wednesday, April 25, 2001 2:11 PM
To: thelist at lists.evolt.org
Subject: RE: [thelist] Regular Expression


In javascript, I was under the understanding the line breaks in strings are
basically equal to '\n'.  If you have the string 'This is line 1\nThis is
line 2' then the '\n' will be replaced by the operating systems cr/lf
combination.  So, the replacement, you may find, won't actually make the
string change... or am I misunderstanding the question?

Are you looking to replace multiple cr/lf's with a single '\n'?

-joshua

> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> Subject: RE: [thelist] Regular Expression
>
>
> JScript or Javascript
>
> -----Original Message-----
> From: Joshua Olson [mailto:joshua at alphashop.net]
> -joshua
>
> > -----Original Message-----
> > From: thelist-admin at lists.evolt.org
> > Subject: [thelist] Regular Expression
> >
> > How do you detect line breaks and replace it with a "\n"? Thanks!
> >
> > - Johnny Lam


---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt ! 




More information about the thelist mailing list