I'm trying to put a wrapper around a bunch of fields that already exist.
I want to convert this:
<div class="editor-label">
@Html.LabelFor(Function(model) model.FirstName)
</div>
<div class="editor-field">
@Html.EditorFor(Function(model) model.LastName)
</div>
To this:
<div class="field-group">
<div class="editor-label">
@Html.LabelFor(Function(model) model.FirstName)
</div>
<div class="editor-field">
@Html.EditorFor(Function(model) model.LastName)
</div>
</div>
I'm pretty green with Regex, but here's the closet I came so far to matching on the pattern:
<div class="editor-label">(.|\r\n)*?(</div>)(.|\r\n)*?(</div>)
Then it could replace with something like this:
<div class="field-group"><div class="editor-label">(.|\r\n)*?(</div>)(.|\r\n)*?(</div>)</div>
But that obviously doesn't work. But the idea would be wrapping around the matched value.
When I use the replace in Notepad++, it replaces it with the string (.|\r\n)*?(</div>)
instead of the matched value.
Can I do a wildcard search and replace that persists the original wildcard matched value?
Or somehow wrap the contents another way?
Note: I'm using Notepad++, but I'd gladly use any other text editor that has this kind of functionality.
Replace with
field?