From e5876bf6ff4a10d111b4ce02de23fd5af7cd1f85 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 19 Jul 2022 09:01:52 -0400 Subject: chapter-2: Add comments for exercises 2.9 and 2.10. I don't feel like solving them. --- chapter-2/2.2-regular-expressions.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'chapter-2') diff --git a/chapter-2/2.2-regular-expressions.scm b/chapter-2/2.2-regular-expressions.scm index 21e3aad..056318a 100644 --- a/chapter-2/2.2-regular-expressions.scm +++ b/chapter-2/2.2-regular-expressions.scm @@ -368,3 +368,26 @@ "frogdog" "frogcat" '(not "frogfrog")) (grep-test (s-regexp->bre (r:repeat 3 5 (r:alt (r:quote "cat") (r:quote "dog")))) "catdogcat" "dogcatdogcat" "catcatcatdogdog" '(not "catdogfrogcatcat")) + + +;; Exercise 2.9: Back-references + + +;; Exercise 2.10: Standards? + +;; a + +;; Differences between BREs and EREs: + +;; - BREs use \( and \) for grouping, EREs use ( and ) + +;; - BREs use \{ and \} for intervals, EREs use { and } + +;; - BREs do not support alternation (non-standard GNU extension +;; provides it), but EREs do. + +;; - GNU-extended BREs use \| for alternation, EREs use | + +;; b + +;; c -- cgit v1.2.3