By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,374 Members | 1,768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,374 IT Pros & Developers. It's quick & easy.

please help me with this regex

P: n/a
Hi

can anyone tell me what is wrong with this expression , it is working
fine in python cmd line
but in JS console it gives error

var spaceRe = /^(<br />|<br/>|<p>|</p>|<\n>|\&nbsp;)*$/gi;

Error: unterminated parenthetical
thanks

Feb 2 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
wrote on 02 feb 2006 in comp.lang.javascript:
can anyone tell me what is wrong with this expression , it is working
fine in python cmd line
but in JS console it gives error

var spaceRe = /^(<br />|<br/>|<p>|</p>|<\n>|\&nbsp;)*$/gi;

Error: unterminated parenthetical


There is much wrong there:

1 / should be escaped \/

2 | if you mean "or" is ||

3 & does not have to be escaped

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.