Tools that turn regular phrases into regular expressions?
I know there are a lot of tools that allow you to create regular expressions and test regular phrases against them, but is there a tool that allows you to ty开发者_Go百科pe just a regular phrase or word, etc and it will generate the regular expression for you. For example, typing:
xyz555.. would generate the correct regular expression. It may not be the most ideal expression, but it would be a useful learning tool.
Because such analysis can't be done deterministically. It's impossible to take a single sample (or any particular number of samples) and generate a pattern.
For example, your example data could mean three alphabetic characters followed by three numeric characters...
...or it could be any number of alphabetic characters followed by three numerics
...or three alphabetic followed by three '5' characters.
It's impossible to determine exactly what the pattern is when more than one pattern fits the data.
精彩评论