RegEx Help needed

General comments and questions. Technical support.
Post Reply
Kiruhdu
Posts: 24
Joined: Tue Sep 05, 2017 9:04 am

RegEx Help needed

Post by Kiruhdu »

Hi there

Maybe it's a dumb question, but I can't find the solution in the Help-File...

I'm searching a regex who catches the paragraph after a heading to format it with no indent.

I've tried: ^p|([!^p]{1,}) with 'Format' ticked and set to Heading1 - but it catches only the heading-paragraph itself...

Can anyone help me please?

thanks in advance
Robert
Posts: 1890
Joined: Fri Aug 15, 2003 8:27 pm

Post by Robert »

The paragraphs following your Heading 1-style paragraphs: do they have specific indent values?
Kiruhdu
Posts: 24
Joined: Tue Sep 05, 2017 9:04 am

Post by Kiruhdu »

Robert wrote:The paragraphs following your Heading 1-style paragraphs: do they have specific indent values?
Yes, indeed - it has indent set to 0,22 cm
Robert
Posts: 1890
Joined: Fri Aug 15, 2003 8:27 pm

Post by Robert »

I don’t think this can be achieved through regex.
Here is how I would go about this:
1. Create a new style that you could call “No Indent” with Paragraph properties including no first line indent, and 0 as the value for both left and right indent.
2. Modify your Heading 1 style so that the “Next Paragraph Style” is the “No Indent” style. This will make sure that any new paragraph following a Heading 1-style paragraph will be associated with the “No Indent” style, and consequently will have no indent. This will take care of new text.
3. Now you need to deal with paragraphs already created. Press Ctrl+F, leave the Find What box empty, and search for Paragraph format with indent set to 0,22 cm. Click the Find & Select All button.
4. When all such paragraphs are selected, apply the “No Indent” style to them.

Here is another way to go about this:
1. Display the “Reveal formatting” panel of the Control Board.
2. The “Paragraph formatting” section of that panel will show you how many fragments are formatted with indent 0,22 cm.
3. Click the number to select all fragments.
4. Apply the “No Indent” style to the selected fragments. Or apply a 0 indent value to the selected paragraphs.
HTH.
Robert
Post Reply