mardi 29 avril 2014

Search and replace and remember with which word the string has been replaced in regex


Vote count:

0




How do i find which substrings were replaced when regex replace was applied in javascript


Main string : abcSSSdeSSfghEEEijSSSkEEElmSSSnSSSEEEopEEE



I want to replace all the substrings starting with 'SSS' and ends with 'EEE'. with .*


Upon applying a desired function i should get modified string



abc.*ij.*lmSSSn.*opEEE


and also the array for replaced strings as follows :


{ var1 : SSSdeSSfghEEE var2 : SSSkEEE var3 : SSSEEE }


How to efficiently implement the above desired function



asked 26 secs ago






Aucun commentaire:

Enregistrer un commentaire