• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSRegularExpression segfault
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRegularExpression segfault


  • Subject: Re: NSRegularExpression segfault
  • From: "Stephen J. Butler" <email@hidden>
  • Date: Mon, 15 Dec 2014 11:50:15 -0600

It seems to be related to the number of capture groups you have. For
example, this also succeeds for me:

((?:1+)|(?:2+)|(?:3+)|(?:4+)|(?:5+)|(?:6+)|(?:7+)|(?:8+)|(?:9+)|(?:0+)|(?:a+))

Do you really need the 11 capture groups?

On Mon, Dec 15, 2014 at 11:20 AM, ecir hana <email@hidden> wrote:
>
>
>
> On Mon, Dec 15, 2014 at 6:09 PM, Stephen J. Butler <
> email@hidden> wrote:
>>
>> If you read the ICU docs on regular expressions you'll see that it sets
>> an 8MB limit on head size when evaluating. My guess is that you've run into
>> this and NSRegularExpression misses a return code somewhere.
>>
>
> I would have thought 50 000 characters is not that much. But then again, I
> don't really know how ICU works... Reading the ICU docs further, there it
> says:
>
> Because ICU does not use program recursion to maintain its backtracking
>> state, stack usage during matching operations is minimal, and does not
>> increase with complex patterns or large amounts of backtracking state.
>
>
>
>> But your pattern is really suboptimal for what you're trying to
>> accomplish.
>>
>
> It's really a reduced test case.
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: NSRegularExpression segfault
      • From: ecir hana <email@hidden>
References: 
 >NSRegularExpression segfault (From: ecir hana <email@hidden>)
 >Re: NSRegularExpression segfault (From: "Stephen J. Butler" <email@hidden>)
 >Re: NSRegularExpression segfault (From: ecir hana <email@hidden>)

  • Prev by Date: Re: WTF is happening?
  • Next by Date: Re: NSRegularExpression segfault
  • Previous by thread: Re: NSRegularExpression segfault
  • Next by thread: Re: NSRegularExpression segfault
  • Index(es):
    • Date
    • Thread