https://github.com/tyru/maton
Convert ERE and Vim regexp bidirectionally
https://github.com/tyru/maton
Last synced: 5 months ago
JSON representation
Convert ERE and Vim regexp bidirectionally
- Host: GitHub
- URL: https://github.com/tyru/maton
- Owner: tyru
- Created: 2018-09-30T19:04:17.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-20T03:57:25.000Z (almost 8 years ago)
- Last Synced: 2025-03-04T03:20:10.596Z (over 1 year ago)
- Language: Prolog
- Size: 33.2 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# maton
Convert ERE and Vim regexp bidirectionally.
## NOTE
* Tested only in SWI-Prolog
* Little bit slow
```
$ make
$ time ./maton -f ere -t vim '^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$'
^\%(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]\d\|\d\)\%(\.\%(25[0-5]\|2[0-4]\d\|1\d\d\|[1-9]\d\|\d\)\)\{3}$
real 0m1.294s
user 0m1.250s
sys 0m0.016s
```
## Introduction
Make executable binary (`./maton` is output binary):
```
$ make
```
Run without making executable binary:
```
$ swipl main.pl ...
```
## Conversion between ERE and Vim pattern
```
swipl main.pl -f ere -t vim {ERE pattern}
swipl main.pl -f vim -t ere {Vim pattern}
```
## Dump node
```
swipl main.pl -f ere -t node {ERE pattern}
```