I'd like to grab the various sections in my code with Regular expressions. I want to write four different regex expressions. The first one is simple, which is to grab the first line that begins with the word extends
. The next three need to grab the sections denoted block head
, block body
, and block scripts
.
I'm a bit lost. So far I've got /^block/m
I'm not looking to respect indentation, just using it for my own visual organization.
extends standard
block head
<title>title</title>
<meta name="description" content="A wonderful thing.">
block body
<h1>Title</h1>
<p>A wonderful paragraph...</p>
block scripts
<script src="/javascritps/html5shiv.js"></script>
I need to be able to grab the identifier after the word block.
Also, separately, I need to grab the HTML content after each block ____ statement.