Jump to content
Sign in to follow this  
etusa

JavaScript RegExp to AutoIt Func ?

Recommended Posts

etusa

How would this Javascript be written as Autoit Code?

// Replace all doubled-up <BR> tags with <P> tags :
var pattern =  new RegExp ("<br/?>[ \r\n\s]*<br/?>", "g");
document.body.innerHTML = document.body.innerHTML.replace(pattern, "</p><p>");

Is what I wrote below, correct?

$HTML = 'paragraph one<br><br>paragraph two<br><br> paragraph 3<br>'
$sResult = StringRegExpReplace($HTML, '<br/?>[ \r\n\s]*<br/?>', '</p><p>')
ConsoleWrite($sResult & @CRLF)

Can someone explain to me precisely what this RegExp does?

How can the RegExp be written so that it works with both <BR> and <br> (lower case)?

Thanks in Advance.

Edited by etusa

Share this post


Link to post
Share on other sites
ChangMinYang

How would this Javascript be written as Autoit Code?

// Replace all doubled-up <BR> tags with <P> tags :
var pattern =  new RegExp ("<br/?>[ \r\n\s]*<br/?>", "g");
document.body.innerHTML = document.body.innerHTML.replace(pattern, "</p><p>");

Is what I wrote below, correct?

$HTML = 'paragraph one<br><br>paragraph two<br><br> paragraph 3<br>'
$sResult = StringRegExpReplace($HTML, '<br/?>[ \r\n\s]*<br/?>', '</p><p>')
ConsoleWrite($sResult & @CRLF)

Can someone explain to me precisely what this RegExp does?

How can the RegExp be written so that it works with both <BR> and <br> (lower case)?

Thanks in Advance.

The 30 Minute Regex Tutorial

http://www.codeproject.com/dotnet/regextutorial.asp

- by Jim Hollenhorst.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.