19727Asterisk in Negative Character Class
- Oct 1 10:31 AMIn a text database, some terms are marked with asterisks for indexing. For example...
Alexander von **Humboldt**'s travel diary of his journey on the **Orinoco** in April **1800** reminds us of the complex and difficult stages of his writing process.
against this string the clip correctly outputs:
The RegEx used here complies with PCRE rules: Inside a Character Class, an asterisk is no metacharacter but a literal asterisk.
Next, I tried to output those terms without the asterisks running...
In this case, the output is quite absurd. An error message pops up saying "Regex error: PCRE does not support \L, \l, \N, \U, or \u" -- although none of these metacharacters is used here.
After OK, the Infobox appears displaying the same error message again.
Obviously, the clip misinterprets the Negative Character Class [^*]. Though PCRE doesn't demand it here, it works if we escape the asterisk with [^\*].
Strange -- isn't it?
- Next post in topic >>