Code: Select all
Haystack=
(
25
30
100
70
70
100
40
105
35
180
10
190
30
5
275
)
MsgBox % RegExReplace(Haystack, "`am)^(?!(5|10|15|20|25|30)$).*\v*")
Code: Select all
Haystack=
(
25
30
100
70
70
100
40
105
35
180
10
190
30
5
275
)
MsgBox % RegExReplace(Haystack, "`am)^(?!(5|10|15|20|25|30)$).*\v*")
https://autohotkey.com/docs/misc/RegEx- ... tm#Options[v1.0.46.06+]: `a recognizes any type of newline, namely `r, `n, `r`n, `v/VT/vertical tab/chr(0xB), `f/FF/formfeed/chr(0xC), and NEL/next-line/chr(0x85). [v1.0.47.05+]: Newlines can be restricted to only CR, LF, and CRLF by instead specifying (*ANYCRLF) in uppercase at the beginning of the pattern (after the options); e.g. im)(*ANYCRLF)^abc$.
Code: Select all
[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.