I'm having trouble getting RegExReplace to work correctly.
My input:
COW MOO OPTION:
test1|test2|test3||
test4|test5|test6||
CHICKEN WING:
test7|test8|test9|test10|test11|test12|test13|test14||test15||||test16|test17||
test18|test19|test20|||test21|test22|test23|test24|test25||
My RegExReplace:
input := RegExReplace(input, "^(\w*\s?)*:$", "")
From my understanding this should remove text similar to COW MOO OPTION: or CHICKEN WING: however when I use MsgBox to view the input I still see the text.
I wish this type of text to be removed, how can this be done?
EDIT:
I think I'm going to go with a Loop, Parse, on a newline.
inquiryRequest := clipboard
Loop, parse, inquiryRequest, `n
{
if instr(A_LoopField, "|")
result := result . A_LoopField . "`n"
}
But I'm still not sure why the RegExReplace didn't work?
:. Since you don't seem to be interested in the actual content of these "headlines", you certainly don't need to match them. Bottom line: If there won't be any colons in the list you're trying to retrieve, simly dismiss those which do contain one. - MCLinStrthe resulting string? this still finds the colon. @MCL, I like your solution but I cannot say for sure that:won't be in the data and that's why I was thinkingRegExReplace, but was hopping for a better way. - Lifeweaver