2014-07-01 4 views
-2

안녕하십니까 [[$ Title]]을 (를) 모든 경우에 shanmugam으로 바꾸고 싶습니다. 여기 내 코드가있다.정규 표현식을 사용하여 모든 발생 문자열을 대체하십시오.

<script> 
    emailContents = '[[FirstName]] [[LastName]] watched "AccelaCast Program" and sent you the following comment and link:[[iaf_message/5]][[#if iaf_message/6 No]]http://webcasts.advanstar.com/acc/iaf/1/[[$PROGRAMID]]/Clicking the URL above will take you to the webcast: "[[$Title]]" [[#else]]http://webcasts.advanstar.com/acc/iaf/1/[[$PROGRAMID]]/?_IAFSegment=[[$SEGMENT]]&_IAFTime=[[$posmmss]]Clicking the URL above will take you to the webcast "[[$Title]]" at the point in the program that [[/User/FirstName]] thought would be most relevant to you.[[#endif]]Message from Advanstar Communications[Sender IP: [[$IP]]] If you believe you have received this email in error, or for customer service at Accela Communications, please send a message to mailto:support.getinfoadvanstar.com Macros program id: [[$programid]] pos: [[$pos]] segment: [[$segment]] pos minutes sec: [[$posmmss]] Title: [[$title]] ip: [[$ip]] link: [[#link http://getinfo2.advanstar.com/ASP/main.jsp Getinfo Getinfo]] Image: [[#img http://getinfo2.advanstar.com/ASP/images/AdvanstarProgram175x37.jpg]] Eval#eval #3.2 floor :[[#eval #3.2 floor ]]' 
    emailContents = emailContents.replace(/\[\[$Title\]\]/g,'shanmugam'); 
    console.log(emailContents); 
</script> 

도와주세요. . 정규식 []에서 shanmugam와 [[FIRSTNAME]]을 대체 할 코드 아래

+1

당신이 사용하는 언어도 지정하지 않았습니다 ... –

+1

'

관련 문제