Hello Andrew,
I think that things are getting confused because you are referring to the data sets as “tabs” when we are trying to match on literal tab characters to figure out where to format text. Perhaps it would help if I explained what my GREP expression is doing.
Here is the entire expression:
.+.+\K.*?(?=(?!£))
Let’s break it down into it’s different pieces so that we can better understand what is happening. Here is part 1:
.+.+\K
.+ this is the expression for one or more characters (any character is covered by this)
– this is a tab character
.+ one or more characters
tab character
\K Ignores everything matched up until this point
so, at this point, the GREP expression is stating that it should match one or more characters TAB one or more characters TAB and then, with the “\K” we are stating that we do not want to apply any character styling to those matches.
Here is part 2:
.*?
.*? this is the expression for zero or more characters. I used this, rather than the “.+” because doing it this way is “non-greedy” meaning that it will match only what it needs to in order to meet the conditions of our statement. Conversely, “.+” is “greedy” – it will always try to match as much as it possibly can.
Part 3 is where things begin to get tricky:
(?=(?!£))
What we have here is a nested look-around (a negative look-ahead nested within a positive look-ahead). We are essentially saying that we want to look ahead to a tab character () that is not followed by “£”.
Let’s see how all of this matches up to the example that you gave:
View post on imgur.com