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

Find and replace fails using RegEx ".+" and character formatting


Recommended Posts

Hi,

In APub 1.8.5.703  (Windows 10) find and replace doesn't work properly when searching is done through the regex ".+" associated with any character format or style setting; in fact, each occurence is finded and listed, but it can't be replaced (it's not even selected in text) unless it's at the end of paragraph. When the regex is changed to "[a-z]+" or to "." OR the format is reset everything works fine (please see the file attached). I've found the same issue in beta 1.9.0.887.

Is this a known bug? Am I missing something?

Cheers,
Cleber

regex_test.afpub

Link to comment
Share on other sites

Just to make sure I know what you were trying:

  1. What Regular Expression Options did you specify?
    image.png.87efe501fdc751b5cf2ff49700dc61dd.png
     
  2. What do you mean by "format bold"? Character Style > Strong, or something else?

-- 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 17.7, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7

Link to comment
Share on other sites

12 hours ago, walt.farrell said:

Just to make sure I know what you were trying:

  1. What Regular Expression Options did you specify?
    image.png.87efe501fdc751b5cf2ff49700dc61dd.png
     
  2. What do you mean by "format bold"? Character Style > Strong, or something else?

Hi, Walt,

1. No options specified (just like the image above).

2. I've tried it first with local formatting (Format > Character font > Font weight > Bold), but got the same result with Format > Character style > Strong)

Thanks!

Link to comment
Share on other sites

Thanks. FYI, there's something a bit weird with your file, but it does not seem to be related to the problem. For example, the "r" in the first "regular" has a character style of  Strong+, which shows in the Text Styles panel as being "Strong + Font Weight: Normal".

So I created my own file, which does not have that problem, but it has the same issue. In playing around, I came up with this:

image.png.0f62859ab0e183abb32697a6ab01e90a.png

  • If I search for .+ with a format of "font weight: bold" or character style Strong it fails.
  • Substituting [a-z0-9 ]+ also fails.
  • Substituting [a-z0-9]+ (without allowing a space) works.
  • And substituting \w+ works.
  • But substituting (\w| )+ fails, as does [\w ]+

So even though the bold/strong text does not have any spaces, if you specify a format option, and you have a pattern that allows matching a space, the search fails to work properly.

Note: "Fails" in this post means that the correct text is found and shows up in the results list, but

  1. is not properly selected on the page and
  2. repeated pressing of Find does not advance to the next result in the results list.

Here's my file, created in the 1.9 beta:

regex_test2.afpub

-- 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 17.7, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7

Link to comment
Share on other sites

You're welcome.

-- 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 17.7, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7

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.