Search and Replace Patterns

If you have Search and Replace patterns that you use regularly, you can cause StrongED to remember these. You must give each pattern (Search or Replace) a unique name and, once set up, you can enter these names, without " ", in the Search box and/or Replace box. Remember to select Advanced.

There are separate patterns (and names) for Search and for Replace. But, to tie Search and Replace together so you can remember them more easily, there is no reason why the same name cannot be used for the Search exprerssion and for the Replace expression. Or a variation on the same name - say Sfoo and Rfoo.

These named expressions can be saved in three places:

  1. ModeFile for current mode, when it is only available in this mode
  2. ModeFile for BaseMode, when it will be available in any mode
  3. Global Patterns file, when it will be available in any mode
StrongED looks for these named expressions in the files in the above order.

Patterns File

StrongED ships without a Patterns file. You'd normally create the file as !StrED_cfg.UserPrefs.Global.Patterns and then populate it with the search and replace expressions as you require.

The Patterns file is essentially a cut down ModeFile which consists of a Search section and a separate Replace section. You use these sections in the same way as you would do in a ModeFile:

Search
   name    search pattern
End

Replace
   name    replace pattern
End

ModeFiles that already include a Search and/or a Replace section

these include:
SearchReplace
BaseMode BaseMode
Diff
EXIFinfo
HTML
JavaScript
Lua
News News
Obey
Perl
PHP
Python
StrongHTML StrongHTML

Was this page helpful? Please email me and/or rate this page:


If you want a reply make sure any email address @torrens.org will not get spam-binned!
Optional comment

Other relevant pages

Top of page


Page Information

http://css.torrens.org/valid-html401-bluehttp://css.torrens.org/valid-css Document URI: http://stronged.torrens.org/man/search/patterns.html
Page first published 12 Jan 2018
Last modified:Mon, 08 Jul 2024 09:18:37 BST
© 2017 - 2024 Richard John Torrens.