iam-TJ/AContent — comment on commit 8ad74b5dda9626f1237e1df96a1183f573d254d2
File: include/classes/Message/Message.class.php line 111
By iam-TJ:

I didn't want to try to write a complex regexp to match all possible format specifiers that are in use or may be used later. Instead, I wrote it to ignore the most common uses of the '%' character that are unlikely to be format-specifiers.

It's not critical if the match isn't 100% since it is an aid to identifying static language text and programmatically created texts that might pass through this function. Once identified by this code they can be fixed and this code retired.

In English the regexp would read:

Find all % symbols that do not present a percentage value (are not immediately preceded by a digit e.g. 5%) and are not an occurrence of a literal '%' character (which in format-specifiers uses "%%") and isn't succeeded by space (since format-specifiers do not contain spaces e.g. %0.4ld).

See http://php.net/manual/en/function.sprintf.php "format". For "%%" see item 6.