regex searching hangs
fortepianissimo at yahoo.com.tw
Sun Feb 8 16:29:10 CET 2004
Could someone explains why the following code hangs (Python 2.3.3)?
--- CODE STARTS ---
--- CODE ENDS ---
>From the syntax and semantics of regex, the entire t should be
consumed by the pattern '\S+(?:\.\S+)+' and the search() call should
return None. Is search() doing a depth-first search and can't pulling
itself out? It doesn't seem right to me, or I'm missing something?
BTW, I don't think any regex matching should ever hang in any
circumstances - correct me if I'm wrong: is halting problem a problem
More information about the Python-list