Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Contributor ,
Sep 12, 2019 Sep 12, 2019

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

 

clipboard_image_0.png

 

 

2.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Sep 14, 2019 Sep 14, 2019

Capture6.JPG

 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.  

Translate
Mentor ,
Sep 12, 2019 Sep 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 12, 2019 Sep 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?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Sep 12, 2019 Sep 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?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 12, 2019 Sep 12, 2019
Ahhhhhh. Thank you for doing that. The original author has users appling 10 p-styles for one box score. I am consolidating that to 4 keystrokes by using GREP styles. This one has tripped me.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 12, 2019 Sep 12, 2019

Capture2.JPG

 

 

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.

 

Capture3.JPG

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Sep 12, 2019 Sep 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…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 12, 2019 Sep 12, 2019
That is how it was originally styled. And normally, that's proper styling. But in this box score it is also 60% more hand-styling multiplied by 25 box scores each night. I was hoping to have a highly efficient workflow.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Sep 12, 2019 Sep 12, 2019
Then seems like it was styled ok, and I don't see a reason to abandon that. Frankly, still couldn't get your workflow and what you're trying to accomplish… Why not to use 2 para styles here: 1. Title: bold type, with paragraph rule below, defined tabs. 2. Body: all the rest lines (paragraphs) in a regular type, defined tabs (since this isn't a table, right?)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 12, 2019 Sep 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. 🙂
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Sep 12, 2019 Sep 12, 2019

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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 13, 2019 Sep 13, 2019

I went down this road now, then stalled.

^([.+\d+\t]{7}[\d+/.\d+\r])

Any number of characters followed by a digit followed by a tab {7 times} leaves me with the ERA to affect. Any number of digits followed by a period followed by any number of digits followed by a return.

Two implicit statements grouped -- nothing.  I had things moving after the first statement. But adding the last part blew it out.

 

Here is a screenshot of the code nearly working, knocking out the rule above.  Will have to escape that somehow. 

 

Capture5.JPG

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 14, 2019 Sep 14, 2019
LATEST

Capture6.JPG

 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.  

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines