Regular Expression Help.
I need a regular expression which removes text from|to : and replace with a space from the following string:
abcd2DPM_0361.DSS|1588224: abcdinterv120808wc.doc|28672: abcdDPM_0360.DSS|563712: abcd3_0365.DSS|1565184: Abcd_Last-GK.DSS|771072:
var s='abcd2DPM_0361.DSS|1588224: abcdinterv120808wc.doc|28672: abcdDPM_0360.DSS|563712: abcd3_0365.DSS|1565184: Abcd_Last-GK.DSS|771072:';
s.replace(/\|[^:]*\:/g,' '); //replace pipe followed by any number of charaters to and including a single colon, with a space
/* returned value: (String)
abcd2DPM_0361.DSS abcdinterv120808wc.doc abcdDPM_0360.DSS abcd3_0365.DSS Abcd_Last-GK.DSS
Thank you for replying. But I am getting 2 spaces after each name eg abcd2DPM_0361.DSS abcdinterv120808wc.doc. I need only 1 space between each name.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)