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.
This should work:
Statute:.+\r
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+\. .+
Copy link to clipboard
Copied
This should work:
Statute:.+\r
Copy link to clipboard
Copied
It does!!!! (I was making it too complicated, I guess.)
Thanks so much.
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?
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?
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.
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.
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+\. .+
Copy link to clipboard
Copied
Amazing. Thanks so much!
Copy link to clipboard
Copied
^§\h[0-9.]+\h.+