How to regex body of a heading in markdown?

by raven_corwin , in category: Third Party Scripts , 4 months ago

How to regex body of a heading in markdown?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by jasen_gottlieb , 4 months ago

@raven_corwin 

To regex the body of a heading in Markdown, you can use the following regular expression pattern:

1
^#{1,6}s(.*)


In this pattern:

  • ^ - asserts the start of a line
  • #{1,6} - matches 1 to 6 hash symbols (#) at the beginning of the line (denoting a heading)
  • s - matches any whitespace character
  • (.*) - captures the rest of the line after the hash symbols and whitespace (i.e., the body of the heading)


You can use this pattern to extract the body of a heading in Markdown using a regular expression tool or programming language that supports regex.

Related Threads:

How to create a line break in doxygen markdown?
How to specify a markdown file as another tab in doxygen?
How to print request body in koa?
How to validate request body in fastapi?
How to send a iframe in email body?
How to get real iframe body height?