0

I need regular expression to be used in PHP that can extract all script tags links (src attributes).

i already have this regex which i created to extract script src values but i'm unable to make it work to find only in the head section

/<script [^>]*src=["|\']([^"|\']+(\.js))/i

hoping someone will check this and test before sending a new regex that can work.

i333
  • 13
  • 8
  • 1
    Don't parse html with regex: http://stackoverflow.com/q/3577641/372239 – Toto Mar 25 '15 at 19:49
  • Thank you for your comment, But I specifically need regex for this particular scenario and i'm aware of the limitations. thank you. – i333 Mar 26 '15 at 01:05

0 Answers0