python regular expression help

7stud bbxx789_05ss at yahoo.com
Thu Apr 12 03:36:29 EDT 2007


On Apr 11, 11:15 pm, attn.steven.... at gmail.com wrote:
> On Apr 11, 9:50 pm, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
> lhs = re.compile(r'\s*(\b\w+\s*=)')
> for s in [ "a = 4 b =3.4 5.4 c = 4.5",
> "a = 4.5 b = 'h'  'd' c = 4.5 3.5"]:
>     tokens = lhs.split(s)
>     results = [tokens[_] + tokens[_+1] for _ in range(1,len(tokens),

The only thing I can think when I look at that is: what a syntactic
abomination.




More information about the Python-list mailing list