RegEx 109- 3 ways to Escape double quotes in AutoHotkey Regular Expression

double quotes in AutoHotkey Regular ExpressionAutoHotkey Merchandise-White Stress ballMuch of the syntax in AutoHotkey RegEx is straightforward.  Having said that when trying to include double quotes () in my pattern I regularly had difficulties.  In the following video  I demonstrate three separate ways you can escape double quotes in AutoHotkey Regular Expressions.

Here’s a video showing how to handle double quotes in AutoHotkey Regular Expression

And this is the syntax I used escaping  quotes in AutoHotkey Regular Expressions in making the video

OuterHTML=
(
<select name="st" id="st">
<option selected="selected" value="20">All results</option>
<option value="13">1 day</option>
)

;***********Storing in variable*******************
;~ RegEx_pattern=selected" value="(?P<Value>.*?)">All results.*?<option value="(?P<Value2>\d+).*? ;done this way- don't need to escape "
;~ RegExMatch(OuterHTML,RegEx_pattern, Sel_)
;~ MsgBox % "first way`r`r" Sel_Value a_tab Sel_Value2

;***********using \x22  *******************
;~ RegExMatch(OuterHTML,"selected\x22 value=\x22(?P<Value>.*?)\x22>All results.*?<option value=\x22(?P<Value2>\d+)\x22.*?", Sel_)
;~ MsgBox % "second way `r`r" Sel_Value a_tab Sel_Value2

;***********repeated ""*******************
RegExMatch(OuterHTML,"selected"" value=""(?P<Value>.*?)"">All results.*?<option value=""(?P<Value2>\d+)"".*?", Sel_)
MsgBox % "third way `r`r" Sel_Value a_tab Sel_Value2

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.