faqts : Computers : Programming : Languages : JavaScript : Language Core : Regular Expressions

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 3 people (67%) answered Yes
Recently 2 of 3 people (67%) answered Yes

Entry

The following regular expression only works with PC why? re = /\r\n/g,

Apr 15th, 2002 03:58
Jean-Bernard Valentaten, Peter Treadwell,


First of all, the regExp you wrote is not valid, since it has no 
exchange rule. I guess what you meant is:
re = /\r/\n/g;
So basically you want to exchange any "return" found in a text 
with "newline".
Second you didn't specify any system that it doesn't work on, so my 
guess is that this won't work on a Mac.
The reason might be, that Macs do not make any difference between \r 
and \n, but that's only a guess.
If you specified the problem a little more, someone might find the bug 
and help you out, but the information you have written is just not 
enough.
Jean