Well, if you put some comments at this page — i will thank you a lot :-)
20090806: Updated to 0.2.0, new features. You can download or take a look at new screenshots, as usually, at WordPress extensions site.
Contents
re.place
— WordPress plugin wich searches content for some regular expression and replaces matching string with specified stuff. It performs this «on the fly», without database content modification. It can be used to substitute virtually anything — you can insert custom smiles, cross-links, make typographic corrections (like replace quote symbols, insert  
where it needed or the like), invent your own markup language etc-etc.
Usage examples see below.
Screenshots
re.place
stores it’s data in a blog’s database and has graphical interface:
Installation
Donwload re.place
module, unpack to wp-contents/plugins
directory and activate via management interface. Now you can use it.
Usage examples
- Custom smiles. Let’s say, we want to replace string YEAH with smile image from Kolobok collection — on each post or page.
We need to insert something like this:
ID 7 Description
Any text that helps you identify this entrySearch for
What isre.place
should search forReplace with
Whatre.place
should place insteadOrder
Order of this entryActive - Replace quotes with «/». We just need to replace
“
with«
and”
with»
. - Easy inserting YouTube fragments. Let’s say we insert YouTube fragmets very often, and we tired to remove non-standard
embed
and type xhtml1.0-awareobject
, so we may wish to write something like YouTube->kIUCTbi_XZs and see instead a video.So, we need to insert an entry:
ID 8 Description
Any text that helps you identify this entrySearch for
What isre.place
should search forReplace with
Whatre.place
should place insteadOrder
Order of this entryActive - It’s quite easy to implement the functionality of cross-linker plugin and add the possibility to open links in new window, and to add
rel="nofollow"
etc-etc. - You may want to implement «better typography» — replace space after dot with
<span style="letter-spacing: 130%"> </span>
, and after that replace\
with a space (entry with greaterre_order
). Bgha-gha… Or more real things — you can replace\
with - Want to insert drop caps easily?.. Use
<drop>L</drop>orem ipsum...
in your posts and replace it with<span class="dropcap">\1</span>
. Use angle brackets, and if you (accidentally) deactivatere.place
, these «tags» won’t mess you page.
Download
You can download re.place
plugin here.
Your bugreports, suggestions, requests etc will be welcomed
(i’m not a programmer, really, i know)
To do (or not to do)
- Make deinstaller
- Think about export-import of
re.place
database? - …
Version history
- 0.2.0:
- Different replaces for authenticated and guests, pages and not pages…
- Option to display list of replaces with HTML chars escaped or not
- 0.1.4:
- Added a (beta-)possibility to specify different replaces for authenticated users and guests
- 0.1.2:
- The plugin directory is now called «replace» — with no dot. Reason — Codex strips that dot anyway, and plugin does not work without prior manual intervention. :-(
- 0.1.1:
- added
re_order
column. - you do not need to enclose pattern in slashes any more.
- added
- First version — 0.1.0. Quite usable.
One Reply to “re.place — regexp search and replace WordPress plugin”