regexlab-cli
v1.0.0
Published
Test, debug, and explain regular expressions from the terminal
Maintainers
Readme
regexlab-cli
Test, debug, and explain regular expressions from the terminal.
Install
npm install -g regexlab-cliCommands
Test a regex
regexlab test "^\d{3}-\d{4}$" "123-4567"Find all matches with groups
regexlab match "\b(\w+)@(\w+\.\w+)\b" "[email protected] [email protected]"
# Or pipe from stdin:
cat emails.txt | regexlab match "\b(\w+)@(\w+\.\w+)\b"Explain regex in plain English
regexlab explain "(?<=@)\w+\.\w+"Interactive REPL
regexlab replCommon patterns library
regexlab patterns # List all
regexlab patterns email # Show details for email pattern
regexlab patterns url
regexlab patterns ip
regexlab patterns phone
regexlab patterns dateAvailable: email, url, ip, ipv6, phone, date, time, hex, uuid, slug, semver, mac, creditcard, jwt, ssn, zipcode, username, password, htmltag, filepath
Generate regex from examples
regexlab gen "2026-03-20" "2025-12-01"Benchmark regex performance
regexlab bench "\d+" --text "42 lazy dogs"
regexlab bench "pattern" --input large-file.txtReplace matches
regexlab replace "\d+" "NUM" "I have 3 cats and 5 dogs"Validate pattern
regexlab validate "(?<=@)\w+"Features
- Color-coded match highlighting
- Capture group extraction
- Named groups support
- Lookahead/lookbehind explanation
- 20+ built-in common patterns
- Pattern generation from examples
- Performance benchmarking
- Interactive REPL with auto-test
- Stdin piping support
- JavaScript and Python flavor notes
License
MIT
