replace simple regex with a native Ruby method (#6732)
replace simple regex with a native Ruby method (#6732)

Merge pull request 6732
fulldecent/jekyll,ryanshaw/jekyll,Strangehill/jekyll,tillgrallert/jekyll,fulldecent/jekyll,tillgrallert/jekyll,Strangehill/jekyll,jekyll/jekyll,getandpost/jekyll.github.io,ryanshaw/jekyll,fulldecent/jekyll,fulldecent/jekyll,jekyll/jekyll,chrisfinazzo/jekyll,jaybe-jekyll/jekyll,jaybe-jekyll/jekyll,x-way/jekyll,ryanshaw/jekyll,Strangehill/jekyll,chrisfinazzo/jekyll,Strangehill/jekyll,tillgrallert/jekyll,jekyll/jekyll,yhironaka/yhironaka.github.io,chrisfinazzo/jekyll,jaybe-jekyll/jekyll,jaybe-jekyll/jekyll,ryanshaw/jekyll,jekyll/jekyll,chrisfinazzo/jekyll,x-way/jekyll,tillgrallert/jekyll,Strangehill/jekyll,x-way/jekyll,tillgrallert/jekyll,x-way/jekyll,getandpost/jekyll.github.io,getandpost/jekyll.github.io