http://qs321.pair.com?node_id=11120433


in reply to Basic but stupid problem i cannot wrap my head around

Are you expecting "b" for the second example? /^(.*?)\// matches both strings, but $1 in the second example is the zero-length string before the slash. Maybe you meant /^(.+?)\//?