2017 © Pedro Peláez
 

library url-regex

Regular expression for matching URLs

image

ippey/url-regex

Regular expression for matching URLs

  • Wednesday, June 28, 2017
  • by Ippey
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

UrlRegex

Regular expression for matching URLs, (*1)

Based on this gist by Diego Perini., (*2)

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');

Ippei Sumida, (*3)

License

MIT, (*4)

The Versions

28/06 2017

dev-master

9999999-dev

Regular expression for matching URLs

  Sources   Download

MIT

The Development Requires