20703Re: regex to remove ties
- May 24, 2010Don <don@...> wrote:
>Here's another take:
> It is possible that there may be more than one tie ...
> I could have: 4T T and then 6T T T ... so ideas how to
> solve this with regex?
^!Find "(\d+)T(?:[^;]++; T)++" WRS
^!Replace "^%N%T|; \KT" >> "^%N%" HARS
The pattern "(\d+)T(?:[^;]++; T)++" is meant to highlight all ties for a given place but only capture its digit(s). The subsequent replacement of any offending Ts is targeting this selection [H] before looping to locate (any) other group of ties.
(\d+)T -- current place followed by a T; parentheses indicate here the only capturing substring, later referred to by ^$GetReSubStrings$
()++ -- followed by a max number of instances (of what's inside parentheses)
?: -- these signify a non-capturing substring
[^;]++ -- max number of any characters (including newlines) that are NOT semicolon
; T -- which are preceding a mandatory semicolon/space/T combo
- << Previous post in topic Next post in topic >>