Jump to content

Gerando expressões regulares a partir de um conjunto de strings


Fernando Mercês

Recommended Posts

  • Administrators

É preciso ter o Node.js instalado pra usar essa:

$ git clone https://github.com/devongovett/regexgen.git
$ cd regexgen
$ npm install regenerate jsesc
 
$ node bin/cli.js casado cagado capado
/ca[gps]ado/
 
$ node bin/cli.js 3300-4455 3300-4400
/3300\-44(?:00|55)/
 
$ node bin/cli.js 'Feliz 2015' 'feliz 2016' 'ferrou 2017'
/fe(?:rrou 2017|liz 2016)|Feliz 2015/

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...