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

GREP find/replace suggestions (split)


Recommended Posts

[edit for context: this was originally in a feature suggestion thread requesting searches by GREP/regular expressions]

I am returning especially to say Thank You :) for listening to our suggestion. It makes me feel like I have had a small part in the shaping of the app.

As this is the first beta iteration of the feature, I have some observations:

1. Ability to save search/replace combos is suggested in another thread, and this was my first thought too.

2. Text size of the two text fields (Find, Replace) as well as the results do not respect app's Font UI Size preference. They stay tiny regardless - hard to make out those tiny regex patterns.

3. Some search characters get replaced with an icon. I think that is helpful. But others that do have icons do not get replaced when one types the equivalent. For example, typing \t gets changed to the tab icon, but \r and \n do not get changed to the new paragraph and line break icons.

4. Is there a way to control the scope of the search (story only, end of the story, document, selection, etc.)? I do use these features.

5. I often make the mistake to come back to an earlier search where I had set formatting conditions. (Yay for search by format and styles by the way! Very useful.) Then my results weren't what I expected. Is there some way to show a small indicator that a style or format condition is set? Maybe a little "reset format" button that only shows up when there is a format set.

An additional suggestion that might help people who do not use regex: A coding IDE that I use has, in additional to regex searches, a little placeholder icon (similar to your icons for \t, etc.)  that can substitute any text. To illustrate (I hope this shows up), he might be able to change all the HTML paragraphs to headings this way, whilst preserving the attributes:

Find: <p❶>❷</p>

Replace: <h2❶>❷</h2>

I wonder whether that would be of use to some. It can be accomplished easily through regex, so I won't be hurting without it, but it may open up a little power to those who don't yet understand regex. Or would it have less use in this context as compared to programming and markup context?

Link to comment
Share on other sites

  • Staff

@garrettm30

I hope you don't mind that I split this post from the original suggestions thread but it was too good imho and needed to be in its own thread for others to discuss or add to your excellent suggestions

Patrick Connor
Serif Europe Ltd

"There is nothing noble in being superior to your fellow man. True nobility lies in being superior to your previous self."  W. L. Sheldon

 

Link to comment
Share on other sites

Some search characters get replaced with an icon. I think that is helpful.

I disagree. Those icons take a lot of space and you have to select them from a dropdown every time. They should have text equivalents, such as \r for line break. If Affinity get serious about providing scripting support, text equivalents of those icons are needed anyway.

Maybe a little "reset format" button that only shows up when there is a format set.

Yes, that would be very useful.

P.

Link to comment
Share on other sites

5 hours ago, Peter Kahrel said:

Those icons take a lot of space

They do take up more space in a relatively narrow panel, so it would be nice to have an option to turn them off.  I wrote code in Perl so the icons might be nice for people less familiar with the regex syntax, but for some of us they are not as helpful as they are space-consuming.

 

5 hours ago, Peter Kahrel said:

you have to select them from a dropdown every time. They should have text equivalents, such as \r for line break

Some if not all of them already have text equivalents.  When you type in the text equivalents (\t for tab, for example) the icon is substituted automatically.  It would be nice if they ALL had such equivalents and they were listed in the menu the way that tab is (the fact that they are not is part of what makes me wonder if only some of them currently do).  I think a paragraph break should be \n but since it is not listed in the menu and does not get substituted I haven't done the testing to verify that yet.

 

I would like to see the following added:

  • An option to restrict individual results to a single paragraph
  • An option to restart searches after the first character of the previous result instead of after the end of the result (this one might need to prevent replace from working)
  • The ability to convert the search results to a list / copy as text
  • "Pipe dream" idea: the ability to use an expression to produce the replacement text (the captured values would become variables to be used in the expression) - with some string manipulation and conditional functions and the ability to detect context (page number, section name, TOC level, etc.)
Link to comment
Share on other sites

16 hours ago, garrettm30 said:

Is there a way to control the scope of the search (story only, end of the story, document, selection, etc.)? I do use these features.

I would love this even if we only had Selection as a choice.

Mac Pro (Late 2013) Mac OS 12.7.4 
Affinity Designer 2.4.0 | Affinity Photo 2.4.0 | Affinity Publisher 2.4.0 | 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

17 hours ago, garrettm30 said:

5. I often make the mistake to come back to an earlier search where I had set formatting conditions. (Yay for search by format and styles by the way! Very useful.) Then my results weren't what I expected. Is there some way to show a small indicator that a style or format condition is set? Maybe a little "reset format" button that only shows up when there is a format set.

There's already an indication. If you have a format option set then the specification is visible below the Find value or below the Replace value. Here's an example of a format set for the Find operation:
image.png.ae5b7f66a6c4b405366ff6bac300c864.png

If it's empty (as for the Replace operation in that example) there's no format information set.

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

23 minutes ago, walt.farrell said:

There's already an indication. If you have a format option set then the specification is visible below the Find value or below the Replace value. Here's an example of a format set for the Find operation:
image.png.ae5b7f66a6c4b405366ff6bac300c864.png

If it's empty (as for the Replace operation in that example) there's no format information set.

Thank you for pointing that out. I'll still make the mistake of forgetting that is set, as I often do, but at least now maybe I can find the solution faster since it is staring me in the face.

Link to comment
Share on other sites

15 hours ago, Patrick Connor said:

@garrettm30

I hope you don't mind that I split this post from the original suggestions thread but it was too good imho and needed to be in its own thread for others to discuss or add to your excellent suggestions

When you put it as kindly as that, how could I mind?

I added a brief note of context to the start of my original comment.

 

1 hour ago, fde101 said:

Some if not all of them already have text equivalents.  When you type in the text equivalents (\t for tab, for example) the icon is substituted automatically.  It would be nice if they ALL had such equivalents and they were listed in the menu the way that tab is (the fact that they are not is part of what makes me wonder if only some of them currently do).  I think a paragraph break should be \n but since it is not listed in the menu and does not get substituted I haven't done the testing to verify that yet.

In Adobe, I am used to using \r for paragraphs and \n for forced line breaks (not new paragraph). But line ending format is not a settled thing across platforms. Whatever they settle on, the ability to type as an alternative to the drop down would be appreciated. For me, the purpose of the drop down is for reminding me when I can’t remember what to type. Currently it only shows the key for a few items, but I expect that will be filled in. Affinity has a great history of making everything available by keystroke.

 

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.