Skip to content

Instantly share code, notes, and snippets.

@heaversm
Last active August 9, 2022 16:30
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 heaversm/df30b8b36505f9b2eb2176fd8c876887 to your computer and use it in GitHub Desktop.
Save heaversm/df30b8b36505f9b2eb2176fd8c876887 to your computer and use it in GitHub Desktop.
regex: wrap all text inside matching tags
  • Find: <p class="italic text-center">(.+?)<\/p>
  • Replace: <p class="italic text-center"><time class="dt-published" datetime="$1">$1</time></p>
  • Example: <p class="italic text-center">03/01/2015</p>
  • Result: <p class="italic text-center"><time class="dt-published" datetime="03/01/2015">03/01/2015</time></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment