I received my author copy of “Regulární výrazy—Kuchařka programátora” last week. This is the Czech translation of Regular Expressions Cookbook. You can buy Regulární výrazy Kuchařka programátora from the publisher cpress.cz or any bookstore that sells Czech language books. Ask for ISBN 978-80-251-1935-8.
While the Russian, German, and Japanese translations are full translations, the Czech translation is an abridged translation. It has only 7 chapters compared to 8 with the original English edition. The last chapter, “Markup and Data Interchange”, was omitted. This chapter has examples on using regular expressions on HTML and XML files and demonstrates some more complex regex techniques. All the other chapters were translated completely.
A RegexBuddy user told me that he couldn’t easily find a detailed explanation of the replacement text syntax supported by the String.replace() function in JavaScript. I had to admin that my own web page about JavaScript’s regular expression support was also lacking. I’ve now added a new Replacement Syntax section that has all the details. I’ll summarize it here:
$1: Text matched by the first capturing group or the literal text $1 if the regex has no capturing groups.
$99: Text matched by the 99th capturing group if the regex has 99 or more groups. Text matched by the 9th capturing group followed by a literal 9 if the regex has 9 or more but less than 99 groups. The literal text $99 if the regex has fewer than 9 groups.
$+: Text matched by the highest-numbered capturing group. Replaced with nothing if the highest-numbered group didn’t participate in the match.
$&: Text matched by the entire regex. You cannot use $0 for this.
$` (backtick): Text to the left of the regex match.
$' (single quote): Text to the right of the regex match.
$_: The entire subject string.