in reply to How to interrupt regular expression matching?

If the regex comes from possible hostile sources you could try to fork, use BSD::Resource to limit the CPU time for the child, and match it only then. (That's what my evalbot in #perl6 does).

As said before, if you have control over the regex, fix the regex instead.

  • Comment on Re: How to interrupt regular expression matching?

Replies are listed 'Best First'.
Re^2: How to interrupt regular expression matching?
by mishuk27 (Initiate) on May 26, 2008 at 22:16 UTC
    why alarm does not work?
      why alarm does not work?

      It depends on how you are (mis)using it. Show us some code, and maybe we can figure out what you are really asking.