^txt2regex$ walks you through building a regular expression using plain English (or Japanese) and then shows you how to use that regex in some popular languages. Below is my test of making a phone number regex that would match 313-555-1234:

[.]quit  [0]reset  [*]color                                         ^txt2regex$
[|]or  [(]open group
!! not supported
RegEx perl    : [0-9]{3}-[0-9]{3}-[0-9]{4}
RegEx php     : [0-9]{3}-[0-9]{3}-[0-9]{4}
RegEx postgres: [0-9]{3}-[0-9]{3}-[0-9]{4}
RegEx python  : [0-9]{3}-[0-9]{3}-[0-9]{4}
RegEx sed     : [0-9]{3}-[0-9]{3}-[0-9]{4}
RegEx vim     : [0-9]{3}-[0-9]{3}-[0-9]{4}
txt2regex --history '26521652165�:2�3�-�:2�3�-�:2�4'

start to match in any part of the line, followed by a special combination {numbers}, repeated exactly 3 times, followed by a specific character, repeated one times, followed by a special combination {numbers}, repeated exactly 3 times, followed by a specific character, repeated one times, followed by a special combination {numbers}, repeated exactly 4 times.


Leave a Reply