Jump to content
You must now use your email address to sign in [click for more info] ×

Publisher: How do you use Regular Expressions with Find and Replace?


Recommended Posts

This is my text

01 New Day
02 Moonlight in the dark night
03 Another Song and Dance.

I need to insert a line break after the two digits.

I enter the following:

Find: \d\d\s
Replace \d\d\n

The line break gets inserted, but my numbers get replaced with dd

e.g.

dd
New Day

dd
Moonlight in the dark night

dd
Another Song and Dance.

 

How can I get it replaced properly, so I keep my numbers, while also having the line break. Thanks!

Also, the line break seems to be a paragraph break and note a line break. 

 

 

Link to comment
Share on other sites

12 minutes ago, Lagarto said:

I suck in regex so this is probably not right, but seems to work in this specific case:

regx.jpg.25a7270832d3c0718115dd3e5e90c2b5.jpg

You can learn regex e.g. at . https://regex101.com/

Thank you so much. Using \n still produced a paragraph break instead of a line break, but I could use the "Special Characters" menu in the "Replace field" to add a line break. 

Link to comment
Share on other sites

  • 2 months later...
45 minutes ago, E9B6 said:

In page plus it would have been ^p^p replace with ^p

Publisher can use regular expressions for find and replace. You will need to use \r\r for the find term and \r  for the replace term. You turn on regular expressions by using the cog wheel on the left of the Find terms.

In the code used for regular expressions ^p means "the beginning of a line followed by a 'p' "

Mac Pro (Late 2013) Mac OS 12.7.6 
Affinity Designer 2.5.5 | Affinity Photo 2.5.5 | Affinity Publisher 2.5.5 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Link to comment
Share on other sites

58 minutes ago, E9B6 said:

I wanted to replace paragraph, paragraph with just one paragraph

In page plus it would have been ^p^p replace with ^p

But for the life of me I cannot see how to do this in publisher.

 

Click the small down arrow in the Find input field and select Special Characters

Do the same for the Replace With input field

 

find.png

To save time I am currently using an automated AI to reply to some posts on this forum. If any of "my" posts are wrong or appear to be total b*ll*cks they are the ones generated by the AI. If correct they were probably mine. I apologise for any mistakes made by my AI - I'm sure it will improve with time.

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.