ippey / url-regex
Regular expression for matching URLs
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/ippey/url-regex
Requires (Dev)
- codeception/codeception: ^2.3
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2025-09-20 22:04:09 UTC
README
Regular expression for matching URLs
Based on this gist by Diego Perini.
Install
composer require ippey/url-regex
Usage
<?php require_once('vendor/autoload.php'); use Ippey\UrlRegex; // true $result = Ippey\UrlRegex::isMatch('This contains URL. http://www.google.com'); // false $result = Ippey\UrlRegex::isMatch('This contains no URL.'); // array('http://www.google.com') $result = Ippey\UrlRegex::match('This contains URL. http://www.google.com'); // array() $result = Ippey\UrlRegex::match('This contains no URL.'); // array('https://www.google.co.jp/?q=github', 'https://www.github.com') $result = Ippey\UrlRegex::match('This contains URL. https://www.google.co.jp/?q=github and https://www.github.com');
Copyright
License
MIT