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

Affinity Publisher: Union of Regex routines


Recommended Posts

16 minutes ago, lacerto said:

RegEx Buddy explanation for search and replace clauses helps to figure out the syntax -- though as mentioned, I might have misunderstood the goal:

First, as far as I can tell, RegexBuddy does not enable the conditional replacement for Boost. At least I was never able to get it to work.

Second, your replacement used (?1\1 and then some more, but the OP does not want to include what matched in capture group 1. They just want the <nnbsp>, not \1<nnbsp> as I understand it.

 

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

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

19 minutes ago, walt.farrell said:

First, as far as I can tell, RegexBuddy does not enable the conditional replacement for Boost. At least I was never able to get it to work.

As the screenshot shows, you need to select extended mode from the options at the top toolbar. The highlighting shows that it works.

19 minutes ago, walt.farrell said:

Second, your replacement used (?1\1 and then some more

I could not make it work without. The first part ?1 indicates the search group (the left hand side of the search criteria as a whole), and \1 the first inner group, at the moment just left guillemot. It could be expanded with or clauses similarly as the replacement part.

Link to comment
Share on other sites

48 minutes ago, laurent32 said:

Is this possible?

Is it possible to insert a unicode value into Regex formulas such as \u+202f, or to indicate a variable such as <nnbsp> that appears in the occurrence display?

Or, is it necessary to paste a narrow non-breaking space <nnbsp> (obtained by U+202F from the text)?

I tried it, yes you can input a unicode U+202F to have the <nnbsp> in the formula.

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Link to comment
Share on other sites

43 minutes ago, lacerto said:

Here is my take, but I may have understood incorrectly OP's intentions:

regexbuddy_boost_extended.thumb.png.572de0bdd887a79b670448961c9625ff.png

RegEx Buddy explanation for search and replace clauses helps to figure out the syntax -- though as mentioned, I might have misunderstood the goal:

regexbuddy_explanation.thumb.png.089c863995c6ba412f0a6016647192bc.png

In Notepad++:

626989377_notepad_boost_extended.thumb.png.31cb8ba958923d97c759f0a0b54bcec8.png

 

Note: I have only InDesign CS6 and QXP2018 at the moment and neither supports extended boost expressions like conditional replacements. I have no idea if the later versions do. But having scripting support (and ability to chain regex searches in case multiple simple find & replace operations are not wanted to be used), or even just an ability to save regex searches naturally makes need for such advanced searches less necessary.

EDIT: <nnbsp> is here simply just a placeholder. If it is used literatlly, it needs to be find + replaced using the actual thin space that the client app understands.

That's great @lacerto, you understood correctly, RegexBuddy looks neat.

I tried with search :

(«)\s|\s(»|:|!|\?|%)

And replace :

?1\1<nnbsp>:<nnbsp>\2

*with <nnbsp> = u+202F ; entered manually using :

image.jpeg.4806a1052ab7484eab1783f74cd2d385.jpeg

But like @walt.farrell said, it doens't work in Publisher 2…

22 hours ago, walt.farrell said:

Therefore, it is most likely that Publisher does not enable this formatting option when issuing the regex_replace call to process the replacement string.

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Link to comment
Share on other sites

5 minutes ago, laurent32 said:

But like @walt.farrell said, it doens't work in Publisher 2…

No, it does not. Version number is high enough but there is no support for extended boost, at least in replacements. Very few apps support it, e.g. I tried to make it work in Visual Studio Code, but no luck. Perhaps with an extra plugin. RegEx Buddy lets test with any of its supported syntaxes whether such conditionals can be converted to another "dialect" but I have not found anything useful so far.

Link to comment
Share on other sites

57 minutes ago, lacerto said:

Very few apps support it,

For Boost (which Publisher uses), the call to the regex_replace function must specify an additional option to request the extended functionality. Publisher apparently doesn't include that option.

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

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

2 hours ago, lacerto said:

As the screenshot shows, you need to select extended mode from the options at the top toolbar. The highlighting shows that it works.

Sorry, but my copy of RegexBuddy doesn't work that way. I'm using a newer copy than you, I think, as it uses Boost::regex 1.78-1.80, where your copy's version ends at 1.77.

But the explain window shows it inserting literal text, not performing the conditional replacement:

image.png.eee12f7d32e6ab35e2aa336788bb2c97.png

And adding the \1 like you used doesn't help.

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

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

7 hours ago, walt.farrell said:

Sorry, but my copy of RegexBuddy doesn't work that way. I'm using a newer copy than you, I think, as it uses Boost::regex 1.78-1.80, where your copy's version ends at 1.77.

I have the latest version 4.14. I hade chosen an ealier boost version as i assumed (possibly wrongly) that Affinity apps use an earlier version.

Here is another example with the latest boost version supported by RegexBuddy and conditional find + replace seems to work fine:

conditional_find_replace_regex.thumb.png.40c62f66f569c909e824d3d5274f1e16.png

I guess the explanation could be better but I do not master RegEx well enough to be able to judge:

regexbuddy_explanation_2.png.e612ae15e5aba8d6ae305e2b93cb4898.png

Link to comment
Share on other sites

Thanks, @lacerto.

I looked, and you had selected one extra option I had not chosen, the "All flavor". I missed that originally. In fact, that setting is all that's needed. The Extended flavor (first box) is not necessary.

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

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

RegexBuddy looks like a tenor, is there an equivalent app for macOS ?

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Link to comment
Share on other sites

28 minutes ago, laurent32 said:

RegexBuddy looks like a tenor, is there an equivalent app for macOS ?

https://alternativeto.net/software/regexbuddy/?platform=mac

(I have no experience with any of them.)

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

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

6 hours ago, lacerto said:

These kinds of changes could easily be applied in a text editor like Word or LibreOffice Writer using macros, before importing text.

It is not a very good idea to take text directly from Word or worse from Write. A text editor is too limited compared to a DTP program and therefore gives a poor assessment of the work to be done. It also contains errors that will be difficult to detect during DTP and will therefore waste a lot of time. It is generally better to use a a word processor as a draft and then run the whole text through a text editor to eliminate artefacts.

That said, good DTP will often alter the text slightly, to make it longer, shorter, or just better.

Having a tool that does all the necessary replacements in one process will save a lot of time.

5 hours ago, laurent32 said:

We don’t have <nnbsp> in the pull down, we only have access to <nbsp>

To use the ‘Narrow no-break space’ character (U+202F) in Affinity Publisher, follow these steps:

  1. Write ‘U+202F’ in the frame text.
  2. Select ‘U+202F’.
  3. Press the ‘Alt +U’ (Windows) or ‘Cmd +U’ (Mac) keys to transform it into a ‘Narrow no-break space’ character.
  4. Copy the resulting character.
  5. Paste the character into your formula.

It would be much better to be able to select <nnbsp> directly in Affinity’s Regex routines, and even better to be able to enter Unicode codes.

6 cœurs, 12 processus - Windows 11 pro - 4K - DirectX 12 - Suite universelle Affinity (Affinity  Publisher, Affinity Designer, Affinity Photo).

Mais je vous le demande, peut-on imaginer une police sans sérifs ?

Link to comment
Share on other sites

1 hour ago, walt.farrell said:

In fact, that setting is all that's needed. The Extended flavor (first box) is not necessary.

I do not know the difference of flavors but it was clear that defaults were not enough to cover conditional find replace (disregarding boost version number). Conditional find replace examples could be found under "boost extended" documentation so I tried that with "All flavors", which helped me to get started. 

 

Link to comment
Share on other sites

28 minutes ago, lacerto said:

so I tried that with "All flavors"

In case it helps with understanding: that is not "All flavors" but "All flavor". And it should be interpreted as "Choose the All flavor of replacement processing" (vs. some other flavor of replacement processing.). That is, it specifies the options ("flavor") used for the replace call. And to use conditional replacement with Boost, you need the format_all option specified = "All" flavor.

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

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

4 hours ago, walt.farrell said:

you need the format_all option specified = "All" flavor.

Thanks for the clarification. Yes, quite concise and cryptic even if it at times resembles natural language!

I have so far managed to deal with RegEx just copy pasting bits on on-demand basis from forums like InDesign Secrets and saved a couple of dozens most useful, but got interested enough because of this forum to try to educate myself with RegexBuddy. But I have noticed that to really understand it, more fundamental learning is needed. I have Jeffrey E. F. Friedl's and Peter Kahrel's books so I guess I have everything that is needed -- except for another life!

But as long as scripting is not available in Affinity apps, I  suppose my RegEx skill level will improve from elementary to basic. Alternative groups with conditional Find + Replace might become quite handy once I find a programming / scripting context that fully supports the feature (too novel to ever having become introduced in the mentioned books) so thanks for bringing it up on the forum!

Link to comment
Share on other sites

13 hours ago, Pyanepsion said:

To use the ‘Narrow no-break space’ character (U+202F) in Affinity Publisher, follow these steps

I think you can go faster with :

image.jpeg.814b392dbcfca0351404f905e3693ba0.jpegimage.jpeg.f1b70cac1d1c7225ebd94efa67eb5646.jpeg

And then you type 2 times the return key.

@MikeTO taught me that way of doing.

But it's on macOS…

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Link to comment
Share on other sites

Note:

22 hours ago, walt.farrell said:

Find: (\s(?=(:|»|%)))|(«)\s

Replace: (?1<nnbsp>:\2<nnbsp>)

With the sentence:

Il lui dit : « je sais. C’est 15 %. ».

The result is incorrect because the ‘«‘ character has been deleted. This gives:

Il lui dit<nnbsp>: <nnbsp>je sais. C’est 15<nnbsp>%.<nnbsp>».

21 hours ago, Andreas CH said:

Find: (\s(?=(:|»|%)))|(?<=«)\s

Replace: (?1<nnbsp>:\2<nnbsp>)

The result is correct:
Il lui dit<nnbsp>: «<nnbsp>je sais. C’est 15<nnbsp>%.<nnbsp>».

Explanations:

These two examples are interesting because they help to understand the difference between (»)\s and (»?<=)\s.

The error in the first replacement formula lies in the use of the positive lookbehind condition (?<=")\s. This condition looks for a white space preceded by a ‘«‘ character. If this condition is true, the white space will be replaced by <nnbsp>.

"Positive lookbehind" is a term that describes a technique used in regular expressions to look for a match that immediately precedes the current position in the string without consuming those characters in the match. In other words, it checks whether a certain pattern exists immediately before the current position in the text, but without including that pattern in the match.

However, in the first formula, there is a syntactic error that makes the lookbehind condition invalid. It lacks a ‘?‘ to specify that the condition is a positive lookbehind. The condition must therefore be (?<=")to be valid.

The absence of a ‘?‘ means that the condition is not a positive lookbehind and has no effect on the string. Therefore, the ‘«‘ character is not found and is not included in the final result, causing the character to be deleted.

6 cœurs, 12 processus - Windows 11 pro - 4K - DirectX 12 - Suite universelle Affinity (Affinity  Publisher, Affinity Designer, Affinity Photo).

Mais je vous le demande, peut-on imaginer une police sans sérifs ?

Link to comment
Share on other sites

1 hour ago, Pyanepsion said:

However, in the first formula, there is a syntactic error that makes the lookbehind condition invalid. It lacks a ‘?‘ to specify that the condition is a positive lookbehind. The condition must therefore be (?<=")to be valid.

No, it's a different mistake. The first one is not using a lookbehind expression at all. It is attempting to simply match the « and include it in the output. But (I think) the \2 in the replacement is incorrect. Try this instead: 

1 hour ago, Pyanepsion said:

Find: (\s(?=(:|»|%)))|(«)\s

Replace: (?1<nnbsp>:\3<nnbsp>)

In combining the two parts of the search regex, I think the first part got an extra capture group that it didn't have in the original. Thus the combined version had an empty group #2 when the second part matched. So we need \3 rather than \2, I think.

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

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

image.png.c342906627fdce3d64547152f48619e6.png

Are you OK with the meaning of (?=exp) and (?<=exp) ?

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Link to comment
Share on other sites

Returning to the very first post…

Seach =

\s(?=(:|»|%))|(?<=«)\s

Replace =

<nnbsp> (entered as a unicode u+202F)

isn't it the solution ?

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Link to comment
Share on other sites

Well… In a little app I 've got :

image.png.5832eb950ff1c4ab0d0e5c1d488fd317.png

But when I try in publisher 2 :

image.png.d826387b4670aa5bc0a742686fbc42f4.png

 is just an example… I get =

image.png.88699cb18363a4fb647800ad0a232205.png

So I don't understand ?????

EDIT : I got the above once but I could not reproduce it again… ???

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Link to comment
Share on other sites

8 minutes ago, laurent32 said:

But when I try in publisher 2 :

image.png.d826387b4670aa5bc0a742686fbc42f4.png

Why are your \ characters highlighted that way? That normally means it's a special character you inserted via the pulldown list.

Does it work if you just type a \ instead?

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

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

I did nothing special to have those "blue" signs, I just copied and pasted plain text…

I thought it was because I'm on Mac ?

But noooooooooo, I guess there is a bug hiding there !!!

Because BINGO :

I changed it inside publisher 2 :

image.jpeg.ebd795dbaea6a1e5d3c26e3d32d479db.jpeg

And for the great part I got :

image.jpeg.85748450cab8232516b7e937a5a13aba.jpeg

Amazing, it worked at last !!!!!!!

What are those "blue" \ ?????

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Link to comment
Share on other sites

The story has not ended…

After I run the search and replace without the "blue" \ => they come back !!

image.jpeg.05e7d5fc764476f588141e87d36a63a1.jpeg

And if I cmd-Z and run the search and replace with those "blue" \ , this time all is correct…

Summary :

if I copy and paste the search formula from plain text, I get the "blue" \ and the s & r is not working…

if I change the "blue" \ to "normal" \ , the s & r works fine…

Clicking elsewhere and coming back to s&r the "normal" \ become "blue" \ again… (and the formula is still working from now on)

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

Link to comment
Share on other sites

Well well well, I tried it all again ; and with or without the "blue" \ (I guess it's normal with affinity over macOS) I get the regex to work fine2023-02-08_17-32-40.jpg.6817ff5cb35a44b24d32fdb455cd87f4.jpg :

Returning to the very first post…

Seach =

\s(?=(:|»|%))|(?<=«)\s

Replace =

<nnbsp> (entered as a unicode u+202F)

Is the solution.

Now we'd have to tuneup that formula to take care of :

; : " «» ? ! % etc…

MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82)
+ 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + 

Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026)
MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345)

Licence Universelle Affinity V2 updated to 2.3.0

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.