johngodley / search-regex

Search Regex adds a powerful set of search and replace functions to WordPress that go beyond the standard searching capabilities, with full regex support.
https://searchregex.com
GNU General Public License v3.0
32 stars 9 forks source link

"Remove all" feature #74

Closed iSevenDays closed 3 years ago

iSevenDays commented 3 years ago

To help track problems please follow this template. If you can provide screenshots then that will help.

We need to be able to replace found patterns with '' (empty string).

Summary

Please add "Remove all" feature for multiple rows.

Currently, I need to select row by row, click on replace row -> remove to remove the row.

Actual Behavior

The "Replace all" is disabled if no input is supplied.

Steps to reproduce

1 Insert a pattern 2 See "Replace all" is disabled

Environment

Search Regex plugin version latest of December 17, 2021.

johngodley commented 3 years ago

You say you want to replace with an empty string, but then you want to remove a row - I'm not sure I'm understanding fully.

To replace with an empty string you can use the dropdown on the right of the replace field.

iSevenDays commented 3 years ago

@johngodley thank you for the quick response.

I want to use Replace all with an empty string for removing matched patterns from the post content.

Here is a screenshot of how I apply it per-row. https://gyazo.com/21c8218e437853e202d2a31de7473391

iSevenDays commented 3 years ago

Example pattern: Match slash (\)+

Replace with an empty string ''

I need to do this for every search result.

johngodley commented 3 years ago

Ok, you can do the same in the global replace field.

iSevenDays commented 3 years ago

@johngodley could you please suggest to me how do I input empty space?

"Replace all" is grayed out, unavailable if I don't enter any text.

Screenshot: https://gyazo.com/c296ac805d2f3ad45f0befd2033af4d7

johngodley commented 3 years ago

As I said, you can use the dropdown to the right of the replace field.

iSevenDays commented 3 years ago

Oh now I see that option, thank you!

I don't know why I couldn't see it first time.