Can you not do {min,max} in the lookbehind regex? ie, instead of this:
$entity = '(?<!&' . '[a-zA-Z0-9]{2}' . '|' . '#[0-9]{2}' . '|' . '[a-zA-Z0-9]{3}' . '|' . '#[0-9]{3}' . '|' . '[a-zA-Z0-9]{4}' . '|' . '#[0-9]{4}' . '|' . '[a-zA-Z0-9]{5}' . '|' . '[a-zA-Z0-9]{6}' . '|' . '[a-zA-Z0-9]{7}' . ')';
Do this: $entity = '(?<!&' . '[a-zA-Z0-9]{2,7}' . '|' . '#[0-9]{2,4}' . ')';
Or is that the assertion format restriction you mention in the comment?
-Brad
List info: http://lists.roundcube.net/dev/ BT/aba52c80
On Thu, 11 Nov 2010 01:32:25 -0800, Brandon Davidson wrote:
Do this: $entity = '(?<!&' . '[a-zA-Z0-9]{2,7}' . '|' . '#[0-9]{2,4}' . ')';
Yes and the error is "lookbehind assertion is not fixed length at offset...".