views:

35

answers:

0
text = text.replace(/\.(?=[a-zA-Z0-9\[])/g, "<span style='background-color: #FF00FF'>.</span>");

I want to use javascript to highlight all full stops that is followed by letters, numbers and [. The above expression works for letters and numbers, but not bracket. Any idea what's wrong?