How do I make use of regular expressions in ECMA script task ?[Keywords : regular, expressions, RegExp, regular expressions]

How do I make use of regular expressions in ECMA script task ?[Keywords : regular, expressions, RegExp, regular expressions]

book

Article ID: KB0091521

calendar_today

Updated On:

Products Versions
TIBCO IntegrationManager -
Not Applicable -

Description

Resolution:
Here is an example that shows how to make use of regular expressions in ECMA script task...

//Example to strip html tags

strInput = "&lthtml&gtkjjljjlj&ltggg&gtjjjllj</ggg&gtnjlkjkljlj</html>";
writeln("Input : " + strInput);
var objRegExp = new RegExp("<(.|\n)+?>");
objRegExp.ignoreCase = true;
objRegExp.global = true;
strOutput = strInput.replace(objRegExp, " ")
writeln("Output : " + strOutput);


If you need more information on how to use regular expressions refer to the following link:
http://home.worldcom.ch/~jmlugrin/fesi/regexpext.html

Issue/Introduction

How do I make use of regular expressions in ECMA script task ?[Keywords : regular, expressions, RegExp, regular expressions]

Environment

Product: TIBCO IntegrationManager Version: 4.5.0 OS: All --------------------