Skip to main content
Inspiring
September 12, 2019
Answered

GREP to catch upper, lower, punct, tabs and numbers -- a linescore

  • September 12, 2019
  • 3 replies
  • 2265 views

I've exhausted my guessing and pecking at this.  Can someone show me how to catch a range of AND's essentially to grab the second line of this linescore.  I got the first line because it is static.  Thank you so much

 

Chicago IP H R ER BB SO ERA
Giiolito, W, 14-6 9 3 0 0 0 12 3.20

 

 

 

    This topic has been closed for replies.
    Correct answer MadMac55

     Voila!!! 

    The first GREP style:   (\w+\tIP\tH\tR\tER\tBB\tSO\tERA)

    The second GERP style:  (\w+\tIP\tH\tR\tER\tBB\tSO\tERA)\K|([\w+,\t ]|[\d+\-\t]|[\d+.\t])

    I happened upon regexr.com and I was off to the races.  

    3 replies

    MadMac55AuthorCorrect answer
    Inspiring
    September 14, 2019

     Voila!!! 

    The first GREP style:   (\w+\tIP\tH\tR\tER\tBB\tSO\tERA)

    The second GERP style:  (\w+\tIP\tH\tR\tER\tBB\tSO\tERA)\K|([\w+,\t ]|[\d+\-\t]|[\d+.\t])

    I happened upon regexr.com and I was off to the races.  

    MadMac55Author
    Inspiring
    September 12, 2019

     

     

    This is the result when I apply that GREP style.  The GREP style above calls a bold character style that holds an underline and a baseline shift of -2 pt.  Then it is back to roman and a baseline shift of -3 pt trying to find the rest of the pitching lines.

     

    winterm
    Legend
    September 12, 2019

    IMO, you shouldn't bother with baseline shift in a such layout. Take time to fix your styles: return baseline shift back to normal, adjust leading and space before/after. I'd also use Paragraph rules instead underline.

    EDIT: and don't use Char style for the whole paragraph, it's a no-no, too…

    winterm
    Legend
    September 12, 2019
    I hear ya. Because of the tab stops being different in width as well as number of stops, those have to be different styles. The GREP is amazing at chunking out extra manual work. And I'm this >| |< close. 🙂

    Well, this one will find paras with one tab ^([^\t\r]+\t)[^\t]+$ this one with two ^([^\t\r]+\t){2}[^\t]+$ with three ^([^\t\r]+\t){3}[^\t]+$ with four ^([^\t\r]+\t){4}[^\t]+$ and so on (just change the number between curly brackets).

    winterm
    Legend
    September 12, 2019

    That’s possible in a number of ways, but you should provide more details, I think.
    If you have exactly what we see: always a separate text story where we need to catch always the last paragraph, this one will work: [^\r]+\Z
    If not, please elaborate.

    MadMac55Author
    Inspiring
    September 12, 2019
    Thanks, Winterm. You are right, I needed to give you just the line. It is the second line. And yout GREP is close. What's happening is I am not getting the -3 pt baseline shift in the Cstyle. Can you translate the grep you are showing?
    winterm
    Legend
    September 12, 2019
    "find everything till the end of text story, except hard break returns". Effectively it selects the last paragraph in a text story (which not always means 'text frame'). Baseline shift? I don't see it, and why you need it? What's your final goal here? Apply different para style? Some character level formatting? Or what?