Skip to content

Instantly share code, notes, and snippets.

@clouedoc
Created January 3, 2022 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clouedoc/db9627034ab518da72cd2e056873ece2 to your computer and use it in GitHub Desktop.
Save clouedoc/db9627034ab518da72cd2e056873ece2 to your computer and use it in GitHub Desktop.
Regexp to get the first line of text
(?m)(?:(.+?)\n(?:(?:.+?)?\n)+.+?$)|(.+?$)
# Replace with "$1$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment