regex to find js links
Moderator: General Moderators
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
regex to find js links
I need a regular expression to find javascript links in a given webpage.
-
jimmy patel
- Forum Newbie
- Posts: 3
- Joined: Sun May 16, 2010 12:14 am
Re: regex to find js links
This expression may help you in finding src js files in given html code
MoonRose Infotech
w: http://www.moonroseinfotech.com
Code: Select all
preg_match_all(~<\s*script[^>]+src=[\"\'](.*?)[\"\'][^>]+>~im, $html_source_code, $Arr_MatchJs);MoonRose Infotech
w: http://www.moonroseinfotech.com
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: regex to find js links
thnx man
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: regex to find js links
This didnt work for me
.
This yes: #<script[\s]+type=[\'\"]text/javascript[\'\"][\s]+src=[\'\"](.+?)[\'\"]></script>#s
but it is missing something
This yes: #<script[\s]+type=[\'\"]text/javascript[\'\"][\s]+src=[\'\"](.+?)[\'\"]></script>#s
but it is missing something