Regex not within <script> tags -


this question has answer here:

need regex. i'd match within given string of html matches pattern \*[a-z0-9\_]+\* not fall in between <script> start , end tags. know has lookarounds, haven't clue how there.

using regex lookaround. can use:

(?!<script>)\*[a-z0-9\_]+\*(?!</script>) 

that match regex if not preceded , postceded script

enter image description here


Comments

Popular posts from this blog

html - jquery - p element wont show after I hid it -

python - BeautifulSoup: How to get the nearest tag -

php - Return Last Insert ID with PDO -