x and y stand for any characters
Final result , should look like this:
Hello,
Auto
Hot
Key
Thx
Code: Select all
Str=
(join`r`n
Hello,
xxxx
©yyyy
Auto
Hot
Key
)
MsgBox, % RegExReplace(Str, "\R\s+\R\s+©.*+\R")
Code: Select all
Str=
(join`r`n
Hello,
xxxx
©yyyy
Auto
Hot
Key
)
MsgBox, % RegExReplace(Str, "\R\s+\R\s+©.*+\R")
If that's the only thing you need, just do like this:
Code: Select all
Str=
(join`r`n
Hello,
xxxx
©yyyy
Auto
Hot
Key
)
MsgBox, Hello,`nAuto`nHot`nKey
Code: Select all
RegExReplace(Str, "\R\R.*\R\R©.*\R")
Code: Select all
MsgBox, % RegExReplace(Str, "\R{0,1}\w+\R+©\w+\R+")
; =>
/*
Hello,
Auto
Hot
Key
*/
Code: Select all
/*
Join syntax not correct -> missing space
join no need
*/
Str=
(join `r`n
Hello,
xxxx
©yyyy
Auto
Hot
Key
)
MsgBox, % Str
p := 0
while p := RegExMatch(Str, "(\p{Lu}\p{Ll}+,?)", match,p+1)
all .= match1 "`n"
MsgBox, % all
What if "any" starting char happens to be upper case? Then it wouldn't work correctly, however your contribution is precious!