Scripts posted recently tagged to regular in Kelpi

1- 2 of 2.

remove CDATA from text using regular expressions

to regular expressions python cdata by nando.quintana

import re
content= """...<![CDATA[donostia-san sebastian]]>..."""
REGEXP = "<!\[CDATA\[(?P<text>[^\]]*)\]\]>"
regexp = re.compile(REGEXP)
content = regexp.sub('\g<text>',content)

scape blanks javascript

to javascript scape regular expression by txus

function cleanBlanks(source){
	temp_string = source;
	source = (temp_string.replace(/^\W+/,'')).replace(/\W+$/,'');
	return source
}
hits counter