Skip to content

Instantly share code, notes, and snippets.

@bishabosha
Created November 3, 2025 14:58
Show Gist options
  • Select an option

  • Save bishabosha/d837c48ff51d9488b277748b21fbce4e to your computer and use it in GitHub Desktop.

Select an option

Save bishabosha/d837c48ff51d9488b277748b21fbce4e to your computer and use it in GitHub Desktop.
Useful Scala string interpolators
extension (ctx: StringContext)
/** Regex pattern */
transparent inline def rg(s: Any*): scala.util.matching.Regex =
ctx.raw(s*).r
/** Whitespace-Separated list*/
transparent inline def ws(s: Any*): IndexedSeq[String] =
ctx.s(s*).split(raw"\s+").filter(_.nonEmpty).toIndexedSeq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment