ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Regex​Explain​Tip

by rubikonx9 ST3

SublimeText 3 plugin for displaying regular expression explanations

Labels utilities

Details

Installs

  • Total 3K
  • Win 2K
  • Mac 974
  • Linux 591
Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8
Windows 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 1
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0

Readme

Source
raw.​githubusercontent.​com

SublimeRegexExplainTip

SublimeText 3 plugin for displaying regular expression explanations

What it looks like

Screenshot

Why?

As some regular expressions are write-only code, it's sometimes useful to obtain a description of what a particular regex actually does. Having it available in a text editor can be an asset.

Installation

Install via Package Control. Alternatively, clone this repository to Packages directory.

How to use

Press Shift+Super+Alt+R to display the explanation of selected text. Currently, a region must be explicitly selected.

Customization

It is possible to use custom CSS files. You can define the CSS file in settings file (navigate to Preferences -> Package Settings -> RegexExplainTip -> Settings - User) under css_file key:

{
    "css_file": "Packages/User/my-custom.css"
}

You should locate the file somewhere under Packages (Preferences -> Browse Packages...) directory.

Dependencies

The plugin uses YAPE::Regex::Explain to obtain the regex explanation. Therefore, Perl with YAPE::Regex::Explain module installed is required.

Caveats

As this plugin relies on external Perl installation and modules, one must have correct environment setup. This includes proper value if Perl's @INC variable, which allows Perl to find required modules. This directory depends on you environment settings, OS, CPAN configuration and so on.

For example, you might need to define the paths in PERL5LIB variable:

export PERL5LIB=/some/perl/installation/directory/lib.

Alternatively, one may add the following line to Perl code declared in get_explanation method:

use lib 'c:/StrawberryPERL/perl/site/lib';