ADDITIONAL USAGE NOTES 2
-
Just to add to aeric325’s useful notes:
- If the Regex[ ] box is unchecked, then the “Search pattern” is a simple literal string, where you specify the text you want to match, and “Replace pattern” is the replacement string.
- Click the Search button to check that your Search pattern is working.
- Click the Replace button to PREVIEW that your Search and Replace patterns are working. It does NOT make any permanent changes.
- Click the Search & Save button to perform a search and replace, that will irreversibly update your posts, etc.
- Check the Regex[ ] box to specify “regex” style wild-card searches. For example, let’s suppose we want to modify a link URL:
- From:
<a href="https://www.mydomain.info/index.php\?title=Some_text">
- To:
<a href="/Some_text/" class="internal">
- Where “Some_text” varies from link to link
Then:
- Search pattern:
@<a href="https://www.mydomain.info/index.php\?title=(.*?)">@
- Replace pattern:
<a href="/$1/" class="internal">
Note that:
- The Search pattern is surrounded by @ symbols which act as delimiters, and are required
- In the search string, the following characters have special meaning: ^.[$()|*+? and must be preceded by a \ if they are to be used literally, such as where you see \?
- In the search string, (.*?) is he the wild-card indicator.
- In the replace pattern, the $1 represents the text found by the wildcard
- This topic was modified 6 years, 5 months ago by .
- This topic was modified 6 years, 5 months ago by .
- This topic was modified 6 years, 5 months ago by .
- This topic was modified 6 years, 5 months ago by .
- This topic was modified 6 years, 5 months ago by .
- This topic was modified 6 years, 5 months ago by .
- This topic was modified 6 years, 5 months ago by .
- This topic was modified 6 years, 5 months ago by .
- This topic was modified 6 years, 5 months ago by .
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘ADDITIONAL USAGE NOTES 2’ is closed to new replies.