Jump to content

Find/Replace special characters


Recommended Posts

Usually you can use the following simple expression ...

[\r\n] = Win cariage return & linefeed (should match either or both then)

[\r]    = Win cariage return

[\n]    = Unix/Mac linefeed

... in a reg expr which should match those characters. Though Publisher might use/have a predefined paragraph end symbol which you can use then instead in a normal find/replace run.

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

Thank you, v_kyr.  I tried /n and it won't work. The FIND function does not recognize it as anything other than text characters.

Have been trying to work an existing .pdf document that was written in Apple Pages.  Loaded it into Publisher, but it comes up with line returns after every line in the doc. Was hoping to use FIND/REPLACE to deal with these. I don't know anyway to get Publisher to recognize this text as continuous. Microsoft used to use the carat ^ symbol to initiate commands, so that line return was ^p.  Having a tough time here. Thanks for your time!

Link to comment
Share on other sites

9 minutes ago, v_kyr said:

Though Publisher might use/have a predefined paragraph end symbol which you can use then instead in a normal find/replace run.

In fact, Publisher does have such a character, and it's available in the pull-down for the Find string:

image.png.0189c76b599d9647b6a3a8b1ef2fa215.png

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Link to comment
Share on other sites

9 minutes ago, redcedar said:

The FIND function does not recognize it as anything other than text characters.

You need to tell it to do a Regular Expression search if you use the regular expression characters that v_kyr showed you:

image.png.66fbbde50c8a39c74c0f495ad0cc4a47.png

 

On the other hand, the Paragraph Break special character should work in either mode.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Link to comment
Share on other sites

14 minutes ago, redcedar said:

Thank you, v_kyr.  I tried /n and it won't work. The FIND function does not recognize it as anything other than text characters.

Have been trying to work an existing .pdf document that was written in Apple Pages.  Loaded it into Publisher, but it comes up with line returns after every line in the doc. Was hoping to use FIND/REPLACE to deal with these. I don't know anyway to get Publisher to recognize this text as continuous. Microsoft used to use the carat ^ symbol to initiate commands, so that line return was ^p.  Having a tough time here. Thanks for your time!

For Unix/Mac based text you search in a regular expression for "\n" and not "/n", since on Unix systems and Macs a \n is the linefeed character. On Windows in texts a line end is instead \r\n, so a carriage return + linefeed. - I would assume that Pages also used \n as linefeeds here when generating a PDF, since usually that's the common way for text handling of Unix (and MacOS is a BSD based Unix) systems.

In reg expressions a "^" indicates a line start position, thus a reg expr like "^A" would search after a capital (uppercase) A at the start of a text line (the ^).

You can play with and test your regular expressions here at https://regex101.com/

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

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.