add regex snippet to ruby