Is it possible to generate strings matching a regular expression string?

Is it possible to display strings matching a regular expression?

Example:

Take an expression /^AD\d{3}/ and displayAD999

What I am doing is checking a string that is pretty simple or contains all numbers, maybe a few characters, and possibly a "-". I am checking the zip code in the form presented in the database of all countries using the zip code.

I could execute it in Javascript or PHP, if that matters.

+5
source share
4 answers

No. This feature is not available.

, , . . .

.

+4

. PEX .

, - javascript.

+4

.

, , .

, AA?99? 9AA | AA?9A 9AA, ( !).

+2

Now there is one for javascript: http://fent.imtqy.com/randexp.js/ .

+2
source

All Articles