php regex: find inline javascript in HTML document -


i need find inline javascript php regex. can find external script, not inline, can me?

here pattern external:

"/<script(.*?)src(.*?)>(.*?)<\/script\s*>/smi" 

any ideas?

update: , <script> nodes without src attribute set:

"/<script((?:(?!src=).)*?)>(.*?)<\/script>/smix" 

(my first look-ahead regex ;))


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -