the_way 52 Posted September 28, 2015 Report Share Posted September 28, 2015 How can i use regex to get the programId=15? I just need to extract the "15" is this possible? Cheers <script type="text/javascript" src='http://adn.ebay.com/files/js/min/jquery-1.6.2-min.js'></script> <script type="text/javascript" src='http://adn.ebay.com/files/js/min/ebay_activeContent-min.js'></script> <script charset="utf-8" type="text/javascript"> document.write('\x3Cscript type="text/javascript" charset="utf-8" src="http://adn.ebay.com/cb?programId=15&campId=5335900092&toolId=10026&keyword=teapots&width=728&height=90&font=1&textColor=000000&linkColor=0000AA&arrowColor=8BBC01&color1=709AEE&color2=[COLORTWO]&format=ImageLink&contentType=TEXT_AND_IMAGE&enableSearch=y&usePopularSearches=n&freeShipping=n&topRatedSeller=n&itemsWithPayPal=n&descriptionSearch=n&showKwCatLink=n&excludeCatId=&excludeKeyword=&catId=&disWithin=200&ctx=n&autoscroll=n&flashEnabled=' + isFlashEnabled + '&pageTitle=' + _epn__pageTitle + '&cachebuster=' + (Math.floor(Math.random() * 10000000 )) + '">\x3C/script>' ); </script> Quote Link to post Share on other sites
addy196 9 Posted September 28, 2015 Report Share Posted September 28, 2015 (edited) alert($find regular expression("<script type=\"text/javascript\" src=\'http://adn.ebay.com/files/js/min/jquery-1.6.2-min.js\'></script> <script type=\"text/javascript\" src=\'http://adn.ebay.com/files/js/min/ebay_activeContent-min.js\'></script> <script charset=\"utf-8\" type=\"text/javascript\"> document.write(\'\\x3Cscript type=\"text/javascript\" charset=\"utf-8\" src=\"http://adn.ebay.com/cb?programId=15&campId=5335900092&toolId=10026&keyword=teapots&width=728&height=90&font=1&textColor=000000&linkColor=0000AA&arrowColor=8BBC01&color1=709AEE&color2=[COLORTWO]&format=ImageLink&contentType=TEXT_AND_IMAGE&enableSearch=y&usePopularSearches=n&freeShipping=n&topRatedSeller=n&itemsWithPayPal=n&descriptionSearch=n&showKwCatLink=n&excludeCatId=&excludeKeyword=&catId=&disWithin=200&ctx=n&autoscroll=n&flashEnabled=\' + isFlashEnabled + \'&pageTitle=\' + _epn__pageTitle + \'&cachebuster=\' + (Math.floor(Math.random() * 10000000 )) + \'\">\\x3C/script>\' ); </script>","(?<=programId=)[0-9]*(?=&campId)")) This will work for you , Regex is (?<=programId=)[0-9]*(?=&campId) Edited September 28, 2015 by addy196 1 Quote Link to post Share on other sites
the_way 52 Posted September 28, 2015 Author Report Share Posted September 28, 2015 Thanks addy really appreciated, Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.