A Ruby-based regular expression editor.
Inspired by: https://rubular.com
- Ruby 3.3
- Ruby on Rails 8.0
- Regexp::Parser a regular expression parser library for Ruby
- Hotwire for building the frontend without using much JavaScript by sending HTML instead of JSON over the wire
- TailwindCSS to not have to write CSS at all
- RailroadDiagrams a tiny Ruby+SVG library for drawing railroad syntax diagrams like JSON.org
- Forman for jsbundling-rails, cssbundling-rails
- Lefthook Fast and powerful Git hooks manager for any type of projects
- Rubocop the Ruby Linter/Formatter that Serves and Protects
- ERB Lint Lint your ERB or HTML files
- Biome Format, lint, and more in a fraction of a second
- RSpec for Ruby testing
- Playwright for E2E testing
- Wasmify Rails tools and extensions to pack and run Rails apps on Wasm
- GitHub Pages for Ruby on Rails on WebAssembly, the full-stack in-browser
- Dependabot automated dependency updates built into GitHub
- Gitleaks Find secrets with Gitleaks
- Brakeman a static analysis security vulnerability scanner for Ruby on Rails applications
- GitHub Actions for testing, linting, and building web application and deploy to GitHub Pages
- Clone the repo locally:
git clone https://github.com/aim2bpg/rubree.git
cd rubree
- Install gem and NPM packages and start the application locally:
bin/setup
-
Then open http://localhost:3000 in your browser.
-
(Optional) Install lefthook:
brew install lefthook
lefthook install
- (Optional) Install gitleaks for lefthook:
brew install gitleaks
Rubocop:
bin/rubocop
ERB Lint:
bin/erb_lint --lint-all
Biome Lint:
bin/yarn biome check
Brakeman (security scan):
bin/brakeman --no-pager --skip-files app/assets/builds/,build/,node_modules/,pwa/,rubies/
Rubocop:
bin/rubocop -a
ERB Lint:
bin/erb_lint --lint-all -a
Biome Lint:
bin/yarn biome check --write
bin/yarn biome migrate --write
Run tests with the default Playwright (Chromium, headless) driver:
bin/rspec
Run tests with a specific driver by setting the DRIVER environment variable:
# Playwright - Chromium (with browser UI)
DRIVER=playwright_chromium bin/rspec
# Playwright - Chromium (headless)
DRIVER=playwright_chromium_headless bin/rspec
# Playwright - Firefox (with browser UI)
DRIVER=playwright_firefox bin/rspec
# Playwright - Firefox (headless)
DRIVER=playwright_firefox_headless bin/rspec
# Playwright - WebKit (with browser UI)
DRIVER=playwright_webkit bin/rspec
# Playwright - WebKit (headless)
DRIVER=playwright_webkit_headless bin/rspec
# Selenium - Chrome (with browser UI)
DRIVER=selenium_chrome bin/rspec
# Selenium - Chrome (headless)
DRIVER=selenium_chrome_headless bin/rspec
# Rack Test (no JS support)
DRIVER=rack_test bin/rspec
- Basic Match Handling: Provides functionality to match regular expressions against test strings.
- Match Positions: Supports the extraction and display of match start and end positions.
- Capture Groups: Extracts and displays capture groups from regex matches.
- Named Captures: Supports capturing named groups from regex matches.
- Regex Quick Reference: Provides a concise list of commonly used regex syntax for quick reference.
- Regex Examples: Interactive examples to test and visualize regex patterns in real-time.
- Execution Time Measurement: Measures and reports the execution time of regex operations.
- Regex Diagram Generation: Generates and visualizes regex patterns using SVG diagrams.
- Regexp Substitution Function: Supports regex-based string substitution.
- Ruby Code Snippet Generation: Automatically generates Ruby code snippets for testing regex patterns.
- Web Interface for Regex Testing: Interactive web UI to test and visualize regular expressions in real-time.
-
Alternation:
a\|b\|c -
Anchors:
\A,^,\b -
Character Classes:
[abc],[^\\],[a-d&&aeiou] -
Character Types:
\d,\H,\s -
Cluster Types:
\R,\X -
Conditional Expressions:
(?(cond)yes-subexp),(?(cond)yes-subexp\|no-subexp) -
Escape Sequences:
\t,\\+,\? -
Free Space: whitespace and
# Comments(x modifier) -
Grouped Expressions:
- Assertions:
- Lookahead:
(?=abc) - Negative Lookahead:
(?!abc) - Lookbehind:
(?<=abc) - Negative Lookbehind:
(?<!abc)
- Lookahead:
- Atomic:
(?>abc) - Absence:
(?~abc)
- Assertions:
-
Back-references:
- Named:
\k<name> - Nest Level:
\k<n-1> - Numbered:
\k<1> - Relative:
\k<-2> - Traditional:
\1through\9
- Named:
-
Capturing:
(abc) -
Comments:
(?# comment text) -
Named Captures:
(?<name>abc),(?'name'abc) -
Options:
(?mi-x:abc),(?a:\s\w+),(?i) -
Passive Captures:
(?:abc) -
Subexpression Calls:
\g<name>,\g<1> -
Keep:
\K,(ab\Kc\|d\Ke)f -
Literals (utf-8):
-
Ruby,ルビー,روبي
-
-
POSIX Classes:
-
[:alpha:],[:^digit:]
-
-
Quantifiers:
- Greedy:
?,*,+,{m,M} - Reluctant (Lazy):
??,*?,+? - Possessive:
?+,*+,++
- Greedy:
-
String Escapes:
- Control:
\C-C,\cD - Hex:
\x20,\xE2\x82\xAC - Meta:
\M-c,\M-\C-C,\M-\cC,\C-\M-C,\c\M-C - Octal:
\0,\01,\012 - Unicode:
\uHHHH,\u{H+ H+}
- Control:
-
Unicode Properties (Unicode 15.0.0):
- Age:
\p{Age=5.2},\P{age=7.0},\p{^age=8.0} - Blocks:
\p{InArmenian},\P{InKhmer},\p{^InThai} - Classes:
\p{Alpha},\P{Space},\p{^Alnum} - Derived:
\p{Math},\P{Lowercase},\p{^Cased} - General Categories:
\p{Lu},\P{Cs},\p{^sc} - Scripts:
\p{Arabic},\P{Hiragana},\p{^Greek} - Simple:
\p{Dash},\p{Extender},\p{^Hyphen}
- Age:
For more detailed information about supported syntax, refer to the official documentation: Supported Syntax - Regexp::Parser GitHub README
Bug reports and pull requests are welcome on GitHub at https://github.com/aim2bpg/rubree
This project is licensed under the MIT License, see the LICENSE file for details