Bug in Delphi XE RegularExpressions Unit
A bug in RegularExpressions.pas in Delphi XE may result in fewer matches or blank matches or in an access violation. This article explains the cause of the bug and how to fix it.
A bug in RegularExpressions.pas in Delphi XE may result in fewer matches or blank matches or in an access violation. This article explains the cause of the bug and how to fix it.
A bug in recent versions of TPerlRegEx caused it to crash when reusing a TPerlRegEx instance with another regular expression because two pointers weren’t set to nil after freeing them.
The split() function makes it easy to split a string when you can use a simple regex to match the delimiters on which you want to split. Often it is much easier to write a regex that matches the content between the delimiters that you want to keep. In such cases, use findall() instead of split().
Perl-style regular expressions treat 12 punctuation characters as metacharacters outside character classes. These characters need to be escaped with a backslash if you want to include them as literal characters in your regex: .^$|*+?()[{\ Inside character classes, these flavors treat a different set of 4 punctuation characters as metacharacters. Only those 4 need to be […]
The regular expression from the Do Follow plugin is dedicated to a single purpose. Repurposing it for your own code will expose shortcomings that don’t matter for the plugin, but may matter for what you’re trying to do. Never copy-and-paste a regex without testing it.
The popular Do Follow WordPress plugin uses a rather inefficient regular expression for its job. Here’s how to improve it.
Zero-length matches are often an unintended result of mistakenly making everything optional in a regular expression. Sometimes they can be useful. In browsers like Firefox, zero-length matches can cause your JavaScript code to loop forever on regex.exec().
Backtracking occurs when the regular expression engine encounters a regex token that does not match the next character in the string. The regex engine will then back up part of what it matched so far, to try different alternatives and/or repetitions. Understanding this process will make all the difference between guessing and understanding why a […]
Recap of 4 articles on regular expressions pitfalls I previously posted to www.regular-expressions.info