please help me with this regex

S

sakcee

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
 
E

Evertjan.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top