help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regex edit mode


From: Rasmus
Subject: Re: regex edit mode
Date: Tue, 30 Sep 2014 20:18:40 +0200
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux)

Igor Sosa Mayor <joseleopoldo1792@gmail.com> writes:

> Sam Halliday <sam.halliday@gmail.com> writes:
>
>> Hi all,
>>
>> It is sometimes confusing, when writing a regex in elisp, to
>> remember all the escaping rules that are in play.
>>
>> Does anybody on this list know of a minor mode that would allow the
>> user to edit regexes so that escaping is not necessary, but for the
>> escaping to occur "under the hood".
>>
>> Imagine being able to place the point over a string containing a regex
>> (which is using escapes) and then call an interactive function which
>> makes the escape characters go away and if special characters are
>> entered, the escapes are added automagically. When exiting the minor
>> mode, the raw string with escapes would appear again.
>>
>> It would be equally fantastic to be able to do this for other
>> languages that have their own escaping rules: java/scala come to
>> mind.
>>
>> Just a thought. It would really brighten up my day if it were possible.
>
> not exactly what you are looking for, but... do you know this function?
>
> ,----[ C-h f regexp-builder RET ]
> | regexp-builder is an alias for `re-builder' in `re-builder.el'.
> | 
> | (regexp-builder)
> | 
> | Construct a regexp interactively.
> | This command makes the current buffer the "target" buffer of
> | the regexp builder.  It displays a buffer named "*RE-Builder*"
> | in another window, initially containing an empty regexp.
> | 
> | As you edit the regexp in the "*RE-Builder*" buffer, the
> | matching parts of the target buffer will be highlighted.
> | 
> | [back]
> `----

There's also rx, a mini lisp-language for regexp.  Visual-regexp on
github might be able to handle external regexp languages.

—Rasmus

-- 
Er du tosset for noge' lårt!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]