From 1ea13483cb3a5d6e0007b49b0ab9cfdb3e9055eb Mon Sep 17 00:00:00 2001 From: Kouki Ooyatsu Date: Thu, 28 Feb 2013 10:56:58 +0900 Subject: 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 ``` --- src/parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parse.y') 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': -- cgit v1.2.3