I have this list:
foo chef.rb baz
bar cucumber.rb bar
baz gem.rb foo
I want to capture all the names without .rb.
My current regexp looks like this:
/([^\s](?:.)*?.(?:rb))/i
But it captures the .rb too.
How do I capture just the base name?
Thanks.
Use this regex instead:
And your base-name will be in the 1st capture group.
See it on rubular.