Need to replace ; allcharacters using:
title = title.replace(//g, '');
1. There's a space after ;
2. By allcharacters I mean A-Z a-z 0-9 _
Need to replace ; allcharacters using:
title = title.replace(//g, '');
1. There's a space after ;
2. By allcharacters I mean A-Z a-z 0-9 _
Last edited by qwikad.com; 09-06-2015 at 01:11 AM.
Actually after I posted this I tried title = title.replace(/\; .*/, ''); and it seems to be working fine. Is there a better way of doing this? It's tripping all characters (which I am fine with).
I find http://www.regexr.com/ a really useful resource for making sure your regular expressions are doing what you want them to.
I'm not a regEx expert but I'd suggest:
That should replace any character (other than a newline) that follows a semicolon (;) with just a semicolon.Code:title = title.replace(/\;+./g, ';');
Hope that helps.
Last edited by dog; 09-04-2015 at 10:18 PM. Reason: subscribing to topic
Thank you, really appreciate it!
Bookmarks