I want to find all texts sourrounded by “#” char, and inside <script> tags.
How would you go about that ? For example in:
awoie awiefaow <script type="javascript"> #bla#ff awa </script> fawe aaa#bla1# <script>awa #bla2# aa</script>ff
the regex should find only #bla# and #bla2#.
I’ve come up with somehting like:
(?i)(?s)((?<=<script.*?>.*?)#.*?#(?=.*?</script.*?>))
but that would also return #bla1#.
What would be good way to aproach this problem ? or is there something more flexible for advanced text searching in multiple files ?
This C# example uses lookbehinds.
Yields: