http://qs321.pair.com?node_id=11120148


in reply to Re^2: Simple way to skip spaces and # comments
in thread Simple way to skip spaces and # comments

If certain things are expected to match more than 32766 times, you need to break it down.

So if the following exceeds the limit,

a+
you have to use
(?:a{1,32766})+
So,
/\G (?: \s++ | \# .*+ )++ /xgc
becomes
/\G (?: (?: \s++ | \# .*+ ){1,32766}+ )+ /xgc
Or maybe even
/\G (?: (?: (?: \s{1,32766}+ )++ | \# (?: .{1,32766}+ )*+ ){1,32766}+ )+ /xgc