Some links:
v2-changes
https://autohotkey.com/v2/v2-changes.htm
Regular Expressions (RegEx) - Quick ReferenceRegEx newline matching defaults to (*ANYCRLF) and (*BSR_ANYCRLF); `r and `n are recognized in addition to `r`n. The `a option implicitly enables (*BSR_UNICODE).
https://autohotkey.com/docs/misc/RegEx-QuickRef.htm
Regular Expressions (RegEx) - Quick Reference
https://lexikos.github.io/v2/docs/misc/ ... ickRef.htm
pcre2syntax specification
https://www.pcre.org/current/doc/html/pcre2syntax.html
Here are some attempts to write equivalent AHK v1/v2 code, but some corrections may be needed.
Code: Select all
;no options specified (AHK v1): `r`n only
RegExMatch(vText, "O)abc") ;AHK v1
RegExMatch(vText, "(*CRLF)abc") ;AHK v2
;no options specified (AHK v2): `r/`n/`r`n
RegExMatch(vText, "O)(*ANYCRLF)(*BSR_ANYCRLF)abc") ;AHK v1
RegExMatch(vText, "abc") ;AHK v2
;`r only
RegExMatch(vText, "`rO)abc") ;AHK v1
RegExMatch(vText, "`r)abc") ;AHK v2
;`n only
RegExMatch(vText, "`nO)abc") ;AHK v1
RegExMatch(vText, "`n)abc") ;AHK v2
;`a (AHK v1): `r/`n/`r`n/`v/`f/Chr(0x85)
RegExMatch(vText, "`aO)abc") ;AHK v1
RegExMatch(vText, "`a)abc") ;AHK v2 ;note: in AHK v2 is it possible to specify `r/`n/`r`n/`v/`f/Chr(0x85) but not Chr(0x2028)/Chr(0x2029)
;`a (AHK v2): `r/`n/`r`n/`v/`f/Chr(0x85)/Chr(0x2028)/Chr(0x2029)
RegExMatch(vText, "`aO)(*BSR_UNICODE)abc") ;AHK v1
RegExMatch(vText, "`a)abc") ;AHK v2
Btw what are the characters that can appear in the initial options, before the closing parenthesis?
[A-Za-z`a`n`r `t]
Any others? Thank you for reading.