regular expression select an entire html script block containing a certain
word
I am trying to select all script blocks, where there is a certain word
inside the block. This is in a text editor with regex search (notepad++).
I am doing a global replace. Here is an example:
<script type='text/javascript'>
//some
//javascript
</script>
<script type='text/javascript'>
//some
//script
//bla bla **magicword** bla bla
//more script
</script>
<script type='text/javascript'>
//some other
//script
</script>
given the above code, I would want the entire second script block to be
matched, becuase "magicword" appeared somewhere in between the script
blocks. I am sure there is a regular expression to do this but I do not
know anything about regex right now. Any help would be much appreciated.
Thanks alot.
No comments:
Post a Comment