2017 © Pedro Peláez
 

library regex-reverse

Regular Expression reverter, generates a string from a provided regular expression

image

niklongstone/regex-reverse

Regular Expression reverter, generates a string from a provided regular expression

  • Wednesday, May 4, 2016
  • by niklongstone
  • Repository
  • 3 Watchers
  • 43 Stars
  • 7,574 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 9 Versions
  • 5 % Grown

The README.md

Regex reverse

Latest Version Software License Build Status Coverage Status Quality Score, (*1)

Regular expression reverter, generates a string from the given regular expression., (*2)

Install

Via Composer, (*3)

``` bash $ composer require niklongstone/regex-reverse:'^0.4.0', (*4)


## Usage ``` php <?php require ('vendor/autoload.php'); use RegRev\RegRev; echo RegRev::generate('\d'); //ouput a random number

For a list of useful regular expression, please visit: Awesome PCRE, (*5)

Supported expressions

Character classes

Expression Description Result
\d digit a number
\D non digit an alpha char
\w word a alphanumeric char
\W non word a non alphanumeric char
\s space a blank space
\S non space a non blank space

Conditional and subgroup

Expression Description Example Result
() subgroup (\d\w)+@ 97a987Ss@
(a b) alternation (a|i)nt | int
* zero or more \d* 123502
+ one or more \d+ 32133
? zero or one \d? 3
{n} {n,} {n,m} from n to m times \w{1,3} np

Ranges

Expression Description Result
[0-9] range 0 to 9 7
[a-d] range a to b b
[0-9c-f] range 0-9 or c-f d
[ab5.] chars in list b
[^ab5.] chars not in list 8

Examples

Expression Result Description
2\d{2}-\d{3}-\d{4} 212-686-1234 US phone number
\(\d{3}\)\s\d{7} (957) 7583632 phone with area code
\w+@\w+\.\D{2,3} yiuh@qwerty.com email
www\.\w+\.com www.h3MEb7k.com URL
192\.\d{3}.255.\d{1,3} 192.134.255.4 Ip address
\D{3,7}\s\D{2}\s\d{2,5} mslchvi Rr 861 US address
<TAG\s.*>.*?<\/TAG> <TAG fNol>ZPXApG</TAG> TAG
004[0-9] \d{7,10} 0044 75132145 europe phone
SE[1-9]{1}\d{1}\s[A-Z]{2}\d{2} SE27 GU35 london SE post code
SE[1-9]{1}\d{1}\s[A-Z]{2}\d{2} SE27 GU35 london SE post code
organi[sz]e organise or organize US or UK spelling

Other features

  • debug: RegRev::debug() will return an array of messages

Contributing

Please see CONTRIBUTING for details., (*6)

Credits

License

The MIT License (MIT). Please see License File for more information., (*7)

The Versions

04/05 2016

dev-master

9999999-dev https://github.com/niklongstone/reverse-regex

Regular Expression reverter, generates a string from a provided regular expression

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

test data generation regex pcre regular expression preg

16/06 2015

0.4.0.x-dev

0.4.0.9999999-dev https://github.com/niklongstone/reverse-regex

Regular Expression reverter, generates a string from a provided regular expression

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

test data generation regex pcre regular expression preg

16/06 2015

0.4.0

0.4.0.0 https://github.com/niklongstone/reverse-regex

Regular Expression reverter, generates a string from a provided regular expression

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

test data generation regex pcre regular expression preg

06/05 2015

0.3.0

0.3.0.0 https://github.com/niklongstone/reverse-regex

Regular Expression reverter, generates a string that match the provided regular expression

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

test data regex match reverse regular expression

05/05 2015

0.2.0

0.2.0.0 https://github.com/niklongstone/reverse-regex

Regular Expression reverter, generates a string that match the provided regular expression

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

test data regex match reverse regular expression

01/05 2015

0.1.1

0.1.1.0 https://github.com/niklongstone/reverse-regex

Regular Expression reverter, generates a string that match the provided regular expression

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

test data regex match reverse regular expression

29/04 2015

0.1.0

0.1.0.0 https://github.com/niklongstone/reverse-regex

Regular Expression reverter, generates a string that match the provided regular expression

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

test data regex match reverse regular expression

13/04 2015

0.0.2

0.0.2.0 https://github.com/niklongstone/reverse-regex

Regular Expression reverter, generates a string that match the provided regular expression

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

test data regex match reverse regular expression

10/04 2015

0.0.1

0.0.1.0 https://github.com/niklongstone/reverse-regex

Regular Expression reverter, generates a string that match the provided regular expression

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

test data regex match reverse regular expression