Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

[deprecated, use visual-regexp/visual-regexp-steroids instead] A Python regexp/replace command for Emacs with interactive visual feedback

tree: cab26de7f7

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 screenshots
Octocat-spinner-32 README.md
Octocat-spinner-32 pyregexp.el
Octocat-spinner-32 pyregexp.py
README.md

pyregexp

pyregexp is a command for emacs which enables you to use Python regular expressions and either a Python string or a Python expression for doing replacements.

While constructing the regexp in the minibuffer, you get live visual feedback for the matches, including group matches:

entering regexp

While constructing the replacement in the minibuffer, you get live visual feedback for the replacements:

entering replacement

Installation

You need a Python interpreter. Add the following code to your init file. Of course you can select your own key.

(add-to-list 'load-path "which-folder-pyregexp-file-in/")
(require 'pyregexp)
(define-key global-map (kbd "C-c r") 'pyregexp-replace)

To customize, use M-x customize-group [RET] pyregexp. You can specify how to invoke the Python interpreter by modifying the pyregexp-command-prefix variable. The default is python ....

Examples

Example 1

Example 1

Example 2

Example 2

Example 3

Example 3

Example 4

Example 4

Something went wrong with that request. Please try again.