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

problem with selecting text found through a regular expression


Recommended Posts

If I use the regular expression .+ coupled with a specific style, the results appear, but selecting them does not move the selection to the found text.

If I repeat the same search coupled with any other style, it will work as expected.

If I use defined query (even if it contains .) coupled with the problematic style, it will work as expected.

Link to comment
Share on other sites

  • Staff

Hi @silvoc,

Thanks for your report!

I can confirm this is already logged with our developers as a bug, I'll be sure to 'bump' this report with your thread now and we hope to have this fixed in an upcoming update.

I hope this helps :)

Please note -

I am currently out of the office for a short while whilst recovering from surgery (nothing serious!), therefore will not be available on the Forums during this time.

Should you require a response from the team in a thread I have previously replied in - please Create a New Thread and our team will be sure to reply as soon as possible.

Many thanks!

Link to comment
Share on other sites

  • 3 months later...

Solved it myself.

Quote

([-]{4,4})\n(.+)\n([\*]{3,3})\n(.+)\n([-]{3,3})

does the trick. 🙂

On 12/2/2021 at 10:15 PM, silvoc said:

If I use the regular expression .+ coupled with a specific style, the results appear, but selecting them does not move the selection to the found text.

If I repeat the same search coupled with any other style, it will work as expected.

If I use defined query (even if it contains .) coupled with the problematic style, it will work as expected.

Silvoc, would you be able to help me with this regex, seeing that you are using it already. I have this "format" where I would like to extract that which is between the four hashes and the  three  stars and turn it into one (quote) style, and that which is between the three stars and three hashes into a quote author style. 

----
Die Wahrheit ist seltsamer als die Fiktion, aber das liegt daran, dass die Fiktion verpflichtet ist, sich an Möglichkeiten zu halten; die Wahrheit ist es nicht.
***
Foo Bar, 16. Jahrhundert
---

Is there a regex that can effect this in Publisher?

TIA,

Helmar

 

Link to comment
Share on other sites

2 hours ago, Helmar said:

would you be able to help me with this regex, seeing that you are using it already. I have this "format" where I would like to extract that which is between the four hashes and the  three  stars and turn it into one (quote) style, and that which is between the three stars and three hashes into a quote author style. 

----
Die Wahrheit ist seltsamer als die Fiktion, aber das liegt daran, dass die Fiktion verpflichtet ist, sich an Möglichkeiten zu halten; die Wahrheit ist es nicht.
***
Foo Bar, 16. Jahrhundert
---

Is there a regex that can effect this in Publisher?

I'm not silvoc of course :) 

It's not clear to me whether you want to retain the ----, ***, and --- when you're done. But deleting them will be easy enough if you don't want them, and they really can't be deleted until the end anyway.

First Find might be something like: ----(.+?)\*\*\*
First Replace: Click the cog icon and specify the format you want to assign. The Replace text is: \1

Second Find: \*\*\*(.+?)---
Second Replace is the same as the first Replace.

Note that if either extract can have more than 1 paragraph you'll need to set the Regular Expression option "dot matches paragraph break". You'll find it in the cog options for the Find field.

-- 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

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.