Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dohliam/portable-regex
A regular expression tool with live-updating search and replace
https://github.com/dohliam/portable-regex
grep regex regular-expression test-regex
Last synced: 9 days ago
JSON representation
A regular expression tool with live-updating search and replace
- Host: GitHub
- URL: https://github.com/dohliam/portable-regex
- Owner: dohliam
- License: mit
- Created: 2015-02-23T21:17:59.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-07-08T22:02:44.000Z (over 4 years ago)
- Last Synced: 2024-11-27T20:33:37.396Z (2 months ago)
- Topics: grep, regex, regular-expression, test-regex
- Language: HTML
- Homepage: https://dohliam.github.io/regex/
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Portable Regex is a simple tool for testing, constructing, debugging, and otherwise working with regular expressions. It's a bit old but still quite useful.
* [1.1 Features](#features)
* [1.1.1 The basics](#the-basics)
* [1.1.2 Other options](#other-options)
* [1.1.3 Special characters](#special-characters)
* [1.2 Credits](#credits)
* [1.3 License](#license)## Features
### The basics
Enter some text in the input text area and a regular expression in the search text box below. The result area on the right will update as you type, highlighting any matches in your input text.
To replace matches with some other text, just enter something in the _Replacement Text_ box. The results will live update again as you type, showing you the result of replacing the matched regex with your replacement text. When you are satisfied with the result, you can use the _Modify orignal_ option to make the changes to your original text in the input window.
Backreferences are supported, either through the _Insert backreference_ button or by using `$1` for the first match, `$2` for the second match, and so on.
### Other options
There are a number of other things you can do with your regex other than just search and replace. The following options are available:
* _Test_ (Search for specified value and return true or false depending on the result.)
* _Exec_ (Search for specified value, and return text of the found results.)
* _Select_ (Highlight matching text.)
* _Grep_ (Print out all lines matching the pattern to the result area. Functions like *nix `grep`. These results can optionally be piped back to the input window.)
* _Reverse Grep_ (Print lines **not** matching the pattern. Functions like *nix `grep -v`. These results can optionally be piped back to the input window.)
* _Modify orignal_ (Show changes in input window. Replaces original text with the value of the text after the matching pattern has been replaced with the contents of the _Replacement text_ box.)
* _Show original_ (Display the original source text.)### Special characters
Pre-composed expressions matching a variety of special characters can be inserted into the search box automatically through the "Insert special characters" drop-down menu. This supports the following characters:
* `\t` - Tab
* `\n` - Linebreak
* `\s` - Whitespace
* `\S` - Any non-whitespace
* `\b` - Word boundary
* `\d` - Any digit [0-9]
* `\w` - Any letter or digit
* `\W` - Any non-word character
* `\w+` - Any word
* `\D` - Any non-digit
* `?` - Non-greedy match
* `*` - Zero or more of prec. term
* `+` - One or more of prec. term
* `.` - Any character
* `\` - Escape
* `[一-龜]` - Any Hanzi
* `[あ-ん]` - Any Hiragana
* `[ァ-ヺ]` - Any Katakana
* `[가-힣]` - Any Hangul
* `[Ё-ё]` - Any Cyrillic
* `[a-ȇ]+` - Any Latin (incl. diacritics)
* `[a-z]` - Any lowercase letter
* `[A-Z]` - Any uppercase letter
* `[^aeiou\\W]` - Any consonant
* `[aeiou]` - Any vowelIf you need to insert a tab character into the replacement text, use the "Insert tab" button.
## Credits
* [milligram](https://github.com/milligram/milligram) CSS by @cjpatoilo, prototyped using [dropin-minimal-css](https://github.com/dohliam/dropin-minimal-css)
## License
MIT -- see LICENSE file for details.
The default text is from [Wikipedia](http://en.wikipedia.org/wiki/Regular_expression) ca. early 2012.
Table of contents generated by [https://github.com/dohliam/tocdown](tocdown).