All Projects → iij → Mruby Regexp Pcre

iij / Mruby Regexp Pcre

Regular expression library for mruby, PCRE version.

Programming Languages

c
50402 projects - #5 most used programming language

Labels

Projects that are alternatives of or similar to Mruby Regexp Pcre

mention-hashtag
Extract mentions (@mention) or hashtags (#hashtag) from any text
Stars: ✭ 16 (+6.67%)
Mutual labels:  regexp
Jflex
The fast scanner generator for Java™ with full Unicode support
Stars: ✭ 380 (+2433.33%)
Mutual labels:  regexp
Regexp Examples
Generate strings that match a given regular expression
Stars: ✭ 483 (+3120%)
Mutual labels:  regexp
subst
Search and des... argh... replace in many files at once. Use regexp and power of Python to replace what you want.
Stars: ✭ 20 (+33.33%)
Mutual labels:  regexp
Regenerate
Generate JavaScript-compatible regular expressions based on a given set of Unicode symbols or code points.
Stars: ✭ 306 (+1940%)
Mutual labels:  regexp
Regexparam
A tiny (308B) utility that converts route patterns into RegExp. Limited alternative to `path-to-regexp` 🙇‍♂️
Stars: ✭ 390 (+2500%)
Mutual labels:  regexp
String.prototype.matchAll
Spec-compliant polyfill for String.prototype.matchAll, in ES2020
Stars: ✭ 14 (-6.67%)
Mutual labels:  regexp
Onigmo
Onigmo is a regular expressions library forked from Oniguruma.
Stars: ✭ 536 (+3473.33%)
Mutual labels:  regexp
Alp
Access Log Profiler
Stars: ✭ 382 (+2446.67%)
Mutual labels:  regexp
Moo
Optimised tokenizer/lexer generator! 🐄 Uses /y for performance. Moo.
Stars: ✭ 434 (+2793.33%)
Mutual labels:  regexp
eslint-plugin-clean-regex
An ESLint plugin for writing better regular expressions.
Stars: ✭ 280 (+1766.67%)
Mutual labels:  regexp
Rex
Your RegEx companion.
Stars: ✭ 283 (+1786.67%)
Mutual labels:  regexp
Picomatch
Blazing fast and accurate glob matcher written JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.
Stars: ✭ 393 (+2520%)
Mutual labels:  regexp
rexreplace
Smooth find & replace CLI as it should be: simple file selection with globs, flexible patterns with regex and dynamic replacements from js code.
Stars: ✭ 19 (+26.67%)
Mutual labels:  regexp
Regulex
🚧 Regular Expression Excited!
Stars: ✭ 4,877 (+32413.33%)
Mutual labels:  regexp
ElementFinder
Fetch data from HTML and XML via xpath/css and prepare it with regexp
Stars: ✭ 29 (+93.33%)
Mutual labels:  regexp
Regexp2
A full-featured regex engine in pure Go based on the .NET engine
Stars: ✭ 389 (+2493.33%)
Mutual labels:  regexp
Commonregex
🍫 A collection of common regular expressions for Go
Stars: ✭ 733 (+4786.67%)
Mutual labels:  regexp
Libfsm
DFA regular expression library & friends
Stars: ✭ 512 (+3313.33%)
Mutual labels:  regexp
Any Rule
🦕 常用正则大全, 支持web / vscode / idea / Alfred Workflow多平台
Stars: ✭ 5,708 (+37953.33%)
Mutual labels:  regexp

mruby-regexp-pcre

"mruby-regexp-pcre" is a regular expression module for mruby, based on PCRE. It provides Regexp and MatchData classes.

Requirements

none (libpcre is bundled).

Example

line = "#hoge"
/^#.*/ =~ line

csv = "a, b, c"
csv.split /,\s*/

kvs = "key: value"
m = /(\w+)\s*:\s*(\w*)/.match(kvs)
key, value = m[1], m[2]

Difference between PCRE and MRI Regexp

MRI (CRuby) PCRE
\h A hexdigit character ([0-9a-fA-F]) a horizontal white space character

Test

If you have mruby source code and imported mruby-regexp-pcre as an mrbgem, just run "rake test" to execute test scripts in test directory:

% cd mruby
% rake test

Or run run_test.rb to check out mruby source code into a temporary directory, and run tests on it:

% cd mruby-regexp-pcre
% ruby run_test.rb test
% rm -rf tmp

Alternatives

If mruby-regexp-pcre does not meet your requirements, try mruby-onig-regexp. It consumes much more memory but has better compatibility with MRI.

Other alternatives:

License

Note: If you build your mruby with bundled PCRE (default), read the pcre/LICENCE file carefully.

This software (except for "pcre" directory) is distributed under the license terms below.

Copyright (c) 2013 Internet Initiative Japan Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].