Regex help

irfan666

Newbie
Joined
Oct 3, 2015
Messages
20
Reaction score
1
Hi i want to select all this script in regex, how to do that ?


thanks

<!-- PopAds.net Popunder Code for -->
<script type="text/javascript" data-cfasync="false">
/*<![CDATA[/* */
var _pop = _pop || [];
_pop.push(['siteId', 2613538]);
_pop.push(['minBid', 0]);
_pop.push(['popundersPerIP', 3]);
_pop.push(['delayBetween', 0]);
_pop.push(['default', false]);
_pop.push(['defaultPerDay', 0]);
_pop.push(['topmostLayer', false]);
(function() {
var pa = document.createElement('script'); pa.type = 'text/javascript'; pa.async = true;
var s = document.getElementsByTagName('script')[0];
pa.src = '//c1.popads.net/pop.js';
pa.onerror = function() {
var sa = document.createElement('script'); sa.type = 'text/javascript'; sa.async = true;
sa.src = '//c2.popads.net/pop.js';
s.parentNode.insertBefore(sa, s);
};
s.parentNode.insertBefore(pa, s);
})();
/*]]>/* */
</script>
<!-- PopAds.net Popunder Code End -->
 
Joke aside, if you want to only capture that script and not other parts of the page that you don't show here (which is what you probably mean, I guess), use this:
<!-- PopAds\.net .*-->\n(((.*)\n)*)<!-- PopAds\.net.*

Re beautifulsoup, I guess the OP wanted PHP
 
Joke aside, if you want to only capture that script and not other parts of the page that you don't show here (which is what you probably mean, I guess), use this:
<!-- PopAds\.net .*-->\n(((.*)\n)*)<!-- PopAds\.net.*

Re beautifulsoup, I guess the OP wanted PHP
Hi i want to select all this script in regex, how to do that ?


thanks

<!-- PopAds.net Popunder Code for -->
<script type="text/javascript" data-cfasync="false">
/*<![CDATA[/* */
var _pop = _pop || [];
_pop.push(['siteId', 2613538]);
_pop.push(['minBid', 0]);
_pop.push(['popundersPerIP', 3]);
_pop.push(['delayBetween', 0]);
_pop.push(['default', false]);
_pop.push(['defaultPerDay', 0]);
_pop.push(['topmostLayer', false]);
(function() {
var pa = document.createElement('script'); pa.type = 'text/javascript'; pa.async = true;
var s = document.getElementsByTagName('script')[0];
pa.src = '//c1.popads.net/pop.js';
pa.onerror = function() {
var sa = document.createElement('script'); sa.type = 'text/javascript'; sa.async = true;
sa.src = '//c2.popads.net/pop.js';
s.parentNode.insertBefore(sa, s);
};
s.parentNode.insertBefore(pa, s);
})();
/*]]>/* */
</script>
<!-- PopAds.net Popunder Code End -->

There are a lot of modifiers in there that could easily go awry given different syntax standards and implementations of regex, so I think It'd be a good idea to ask OP what kind of regex he's using, and what program/script/language he's using to implement it.
 
There are a lot of modifiers in there that could easily go awry given different syntax standards and implementations of regex, so I think It'd be a good idea to ask OP what kind of regex he's using, and what program/script/language he's using to implement it.
True, I went by the tags which said "PHP", but that might not be true? OP?
 
Joke aside, if you want to only capture that script and not other parts of the page that you don't show here (which is what you probably mean, I guess), use this:
<!-- PopAds\.net .*-->\n(((.*)\n)*)<!-- PopAds\.net.*

Re beautifulsoup, I guess the OP wanted PHP
thanks its work
 
Back
Top