Regular Expression In JavaScript
-
Hi I am new to regular expression, I have situation where I need to grab the value from the html page between the html tags and write out some where in that page. for example if I would like to grab the date between the open tag and close tag below. what should I do? Assume every page I will have Date_x0020_updated in side of open tag and close tag. 2005-04-06T00:00:00Z Thanks in advanced Lair
-
Hi I am new to regular expression, I have situation where I need to grab the value from the html page between the html tags and write out some where in that page. for example if I would like to grab the date between the open tag and close tag below. what should I do? Assume every page I will have Date_x0020_updated in side of open tag and close tag. 2005-04-06T00:00:00Z Thanks in advanced Lair
Use the method getElementsByTagName with the arguement "mso:Date_x0020_updated" which will return u a collection of those objects in the html page. Then with each HTML object call "innerText" or "innerHTML" to obtain the content between the object tags. No need for regular expressions to do this. or if getElementsByTagName is not available and you are using the HTMLDOM then try the document.all.tags("mso:Date_x0020_updated") to get a collection of objects and then for each item in the collection use innerText or innerHTML. Cheers, -Erik