Brownian motion

around the essentials…

 

re.place — regexp search and replace WordPress plugin

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

  1. Screenshots
  2. Installation
  3. Usage examples
  4. Download
  5. To do
  6. Version history

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:

Insert entry window:

Edit entry:

List of entries:

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 entry
    Search for
    What is re.place should search for
    Replace with
    What re.place should place instead
    Order Order of this entry
    Active
  • 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-aware object, 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 entry
    Search for
    What is re.place should search for
    Replace with
    What re.place should place instead
    Order Order of this entry
    Active
  • 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 greater re_order). Bgha-gha… Or more real things — you can replace with non-breaking space, and \ with by entry with higher «order» number.
  • 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) deactivate re.place , these «tags» won’t mess you page.

Download

You can download re.place plugin here.

Your bugreports, suggestions, requests etc will be welcomed nice smile

(i’m not a programmer, really, i know)

To do (or not to do)

  1. Make deinstaller
  2. Think about export-import of re.place database?

Version history

  • 0.2.0:
    1. Different replaces for authenticated and guests, pages and not pages…
    2. Option to display list of replaces with HTML chars escaped or not
  • 0.1.4:
    1. Added a (beta-)possibility to specify different replaces for authenticated users and guests
  • 0.1.2:
    1. 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:
    1. added re_order column.
    2. you do not need to enclose pattern in slashes any more.
  • First version — 0.1.0. Quite usable. nice smile
(4 votes, average: 4.75 out of 5)

Recent Posts

Most Rated

Highest Rated

Tags

Archives