diff options
| author | Kouki Ooyatsu <[email protected]> | 2013-02-28 10:56:58 +0900 |
|---|---|---|
| committer | Kouki Ooyatsu <[email protected]> | 2013-02-28 11:16:15 +0900 |
| commit | 1ea13483cb3a5d6e0007b49b0ab9cfdb3e9055eb (patch) | |
| tree | 3702c8325da78f5c39228272a8ea567c18b63524 | |
| parent | fbe041768bf133268b63344957acb05962df41c7 (diff) | |
| download | mruby-1ea13483cb3a5d6e0007b49b0ab9cfdb3e9055eb.tar.gz mruby-1ea13483cb3a5d6e0007b49b0ab9cfdb3e9055eb.zip | |
Regexp: %r notation bug fix. close #85.
be able to parse any delimiters.
variable expansion isn't supported yet.
* sample code
```
def matchpath(str)
puts "#{str} is ..."
if %r!img/! =~ str then
puts "match"
else
puts "not match"
end
end
matchpath("img/a.png") # => match
matchpath("/usr/local/bin") # => not match
matchpath("book/img/local") # => match
```
| -rw-r--r-- | src/parse.y | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parse.y b/src/parse.y index 365bc5f18..2c5690ea3 100644 --- a/src/parse.y +++ b/src/parse.y @@ -4440,7 +4440,7 @@ parser_yylex(parser_state *p) p->lex_strterm = new_strterm(p, str_regexp, term, paren); #endif p->regexp = 1; - p->sterm = '/'; + p->sterm = term; return tREGEXP_BEG; case 's': |
