In GREP, how to find a line of text, starting with a specific word and ending with a paragraph mark

Participant ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

I'm trying to find a line of text that starts with a specific word plus a colon and ends with a paragraph mark. I played around with some wild cards and/or positive look behind but clearly am not adept enough at these kind of seraches to figure this out. Here's an example of the specific text I want to find:

 

        Statute: Section 1202. State Certificates.

 

Every line starts with "Statute: " and ends with a paragraph mark (return). FYI, after I find this type of line, I want to change its Paragraph style, which I know how to do.

 

 

TOPICS
How to

Views

167

Likes

Translate

Translate

Report

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 2 Correct answers

Adobe Community Professional , Mar 01, 2022 Mar 01, 2022
This should work:   Statute:.+\r  

Likes

Translate

Translate
Adobe Community Professional , Mar 01, 2022 Mar 01, 2022
As long as the ones you don't want to find are not at the beginning of a paragraph, this should work. It finds your text when it occurs at the beginning of a paragraph. ^~6 \d+\.\d+\. .+

Likes

Translate

Translate
Adobe Community Professional ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

This should work:

 

Statute:.+\r

 Capture d’écran 2022-03-01 à 15.33.05.jpg

Likes

Translate

Translate

Report

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
Participant ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

It does!!!! (I was making it too complicated, I guess.)

Thanks so much.

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

Are there instances where this pattern appears mid-paragraph, and if so, are those instances not intended to change to the new paragraph style?

Likes

Translate

Translate

Report

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
Participant ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

Good question. I'm pretty sure the answer is no. And jmlevy's answer, above, worked for me.

But, just for my edification, if I'd said yes, do you have a suggestion?

Likes

Translate

Translate

Report

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
Participant ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

Actually, I do have other instances where the answer is YES, so I'm definitely interested in your response to this! I know I could put a \r in front of it to find only the instances where it's on its own line, but then the change Para Style would apply to the previous para, right?

 

FYI, In this case, a sample stand-alone line I am looking for would be:

 

     § 49.143. Vocational Instructional II.

 

The would always start with "§ ". But there are numerous cases where "§ " appears in the middle of a para, which I would not want to find.

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

I asked becasue I was not yet able to find a solution that would exclude mid-paragraph instances. Every solution I tried so far also found the mid-paragraph instances, and selected from there to the end of the paragraph. 

Screen Shot 2022-03-01 at 10.51.43 AM.png

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

As long as the ones you don't want to find are not at the beginning of a paragraph, this should work. It finds your text when it occurs at the beginning of a paragraph.

 

^~6 \d+\.\d+\. .+

 

Likes

Translate

Translate

Report

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
Participant ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

Amazing. Thanks so much!

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

LATEST

^§\h[0-9.]+\h.+

Likes

Translate

Translate

Report

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