$` The text before matching -- In your code, that's $in $' The text which comes after the match in an input string -- Alt: Lookarounds $& The text of the match itself -- Use captures instead