On Mon, 9 Aug 2010 17:04:16 +0530 Vishal <vsapr...@gmail.com> wrote: > Hello fellas, > > I am trying to create a python function that can take an plain > english description of a regular expression and return the > regular expression to the caller. [...]
> - literal: 'a' > - one_of: 'b,c' > - one_or_more_of: 'd' > - zero_or_more_of: 'e' [...] While regular expressions are not Turing complete, this will quickly get out of control. Will your grammar include things like at_least_three_but_not_more_than_five_of, named groups, extensions, lookaheads, lookbehinds, etc.? Just for fun, consider rewriting the example below: http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html I agree with other posters that there is probably not much practical use for this, except maybe as an exercise to write a regular expression engine. I cannot think of someone experienced in regular expressions who would want to go through the extra verbosity. It might be of marginal use to novices, but IMHO, the effort needed to learn this would be better invested in learning regular regular expressions. Regards, Gora _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers