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 2K
  • Win 936
  • OS X 472
  • Linux 321
Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8
Windows 1 0 0 2 0 0 1 1 2 0 0 1 2 0 1 2 2 2 1 1 1 1 0 1 0 1 0 0 3 0 0 0 1 2 0 3 0 1 1 4 1 2 0 1 1 4
OS X 1 0 0 0 0 0 1 1 1 0 1 0 0 0 0 0 0 0 1 0 0 2 0 1 2 0 0 2 0 1 0 0 1 0 0 2 0 2 1 0 1 0 0 1 0 2
Linux 0 1 0 0 2 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1 3 2 0 0 1 0 0 0 0 0 0 0 0 1 1 1 1 0 1

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';