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.

2
  • 1
    Don't parse html with regex: stackoverflow.com/q/3577641/372239 Commented Mar 25, 2015 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. Commented Mar 26, 2015 at 1:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.