Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returns nil instead of regex match group inside conditional #2787

Closed
kaiserprogrammer opened this issue Mar 31, 2015 · 1 comment
Closed
Labels

Comments

@kaiserprogrammer
Copy link

Problem with DBI gem under jruby-9.0.0.0.pre

def parse_url(driver_url)
  if driver_url =~ /^(DBI|dbi):([^:]+)(:(.*))$/ 
    [$2, $4]
  else
    raise InterfaceError, "Invalid Data Source Name"
  end
end

parse_url("dbi:jdbc:sqlite")

returns [nil, nil] instead of ["jdbc", "sqlite"]

@enebo enebo added this to the 9.0.0.0.pre2 milestone Apr 1, 2015
@enebo enebo added the ir label Apr 1, 2015
@enebo
Copy link
Member

enebo commented Apr 1, 2015

Randomly guessing this was an IR bug and not a regexp problem. I do not see this issue anymore on HEAD:

system ~/work/jruby master *+ 1404% jruby -Xjit.threshold=0 -Xjit.background=false  ../snippets/re2.rb 
["jdbc", "sqlite"]
system ~/work/jruby master *+ 1405% jruby -X-C -Xjit.threshold=0 -Xjit.background=false  ../snippets/re2.rb 
["jdbc", "sqlite"]
system ~/work/jruby master *+ 1406% jruby -X-C -Xjit.threshold=100000 -Xjit.background=false  ../snippets/re2.rb 
["jdbc", "sqlite"]

The syntax is a little arcane but I am testing startup interpreter, full interpreter, and JIT. Resolving.

@enebo enebo closed this as completed Apr 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants