Replace spaces with '\s'

grex

  • Simple command-line tool to generate regular expressions.
    More information: <https://github.com/pemistahl/grex>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

grex -s {{space_separated_strings}}

click the source code to copy