Re: Regarding Regex timeout behavior to minimize CPU consumption

2020-12-06 Thread Dan Stromberg
On Sun, Dec 6, 2020 at 2:37 PM Barry wrote: > > On 5 Dec 2020, at 23:44, Peter J. Holzer wrote: > > > > On 2020-12-05 23:42:11 +0100, sjeik_ap...@hotmail.com wrote: > >> Timeout: no idea. But check out re.compile and re.iterfind as they > might > >> speed things up. > > > > I doubt that com

Re: Regarding Regex timeout behavior to minimize CPU consumption

2020-12-06 Thread Barry
> On 5 Dec 2020, at 23:44, Peter J. Holzer wrote: > > On 2020-12-05 23:42:11 +0100, sjeik_ap...@hotmail.com wrote: >> Timeout: no idea. But check out re.compile and re.iterfind as they might >> speed things up. > > I doubt that compiling regular expressions helps the OP much. Compiled > r

Re: Regarding Regex timeout behavior to minimize CPU consumption

2020-12-05 Thread Peter J. Holzer
On 2020-12-05 23:42:11 +0100, sjeik_ap...@hotmail.com wrote: >Timeout: no idea. But check out re.compile and re.iterfind as they might >speed things up. I doubt that compiling regular expressions helps the OP much. Compiled regular expressions are cached, but more importantly, if a match t

Re: Regarding Regex timeout behavior to minimize CPU consumption

2020-12-05 Thread sjeik_appie
Hi, Timeout: no idea. But check out re.compile and re.iterfind as they might speed things up. I often compile a regex once upon import, then use it in functions On 27 Nov 2020 13:33, Shahique Khan wrote: Hi Team, I have noticed if our regex sometimes does not give a resu

Regarding Regex timeout behavior to minimize CPU consumption

2020-11-27 Thread Shahique Khan
Hi Team, I have noticed if our regex sometimes does not give a result and on that time regex took more time in returning response (empty response). My Question is can we set a timeout parameter (in seconds/millisecond) with re.find or anywhere in code to avoid CPU consumption if regex takes more