| 1 |
# mruby-onig-regexp |
| 2 |
|
| 3 |
[](https://travis-ci.org/mattn/mruby-onig-regexp) |
| 4 |
|
| 5 |
## install by mrbgems |
| 6 |
```ruby |
| 7 |
MRuby::Build.new do |conf| |
| 8 |
|
| 9 |
# ... (snip) ... |
| 10 |
|
| 11 |
conf.gem :github => 'mattn/mruby-onig-regexp' |
| 12 |
end |
| 13 |
``` |
| 14 |
|
| 15 |
## Example |
| 16 |
```ruby |
| 17 |
|
| 18 |
def matchstr(str) |
| 19 |
reg = Regexp.compile("abc") |
| 20 |
|
| 21 |
if reg =~ str then |
| 22 |
p "match" |
| 23 |
else |
| 24 |
p "not match" |
| 25 |
end |
| 26 |
end |
| 27 |
|
| 28 |
matchstr("abcdef") # => match |
| 29 |
matchstr("ghijkl") # => not match |
| 30 |
matchstr("xyzabc") # => match |
| 31 |
``` |
| 32 |
|
| 33 |
## License |
| 34 |
|
| 35 |
MIT |
| 36 |
|
| 37 |
### License of Onigmo |
| 38 |
BSD licensed. |
| 39 |
|
| 40 |
Onigmo (Oniguruma-mod) -- (C) K.Takata <kentkt AT csc DOT jp> |
| 41 |
Oniguruma ---- (C) K.Kosako <sndgk393 AT ybb DOT ne DOT jp> |
| 42 |
|
| 43 |
## Author |
| 44 |
|
| 45 |
Yasuhiro Matsumoto (a.k.a mattn) |