http://www.perlmonks.org?node_id=573949


in reply to Null scalars in array

The + means match . (any non-\n character) one or more times. Use * instead, which means 0 or more times. You'll still be requiring two spaces between foo and bar; if you have just one, /foo ?(.*) bar/ may do what you want.