From bca630f926cb8ddaf6399df13b161a4d77bcdf55 Mon Sep 17 00:00:00 2001 From: Indigo Tech Date: Mon, 13 May 2024 20:55:09 -0500 Subject: [PATCH 1/2] Explain swift regex and the need to escape backslashes --- Docs/PathConfiguration.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Docs/PathConfiguration.md b/Docs/PathConfiguration.md index 7046fad..11f6f06 100644 --- a/Docs/PathConfiguration.md +++ b/Docs/PathConfiguration.md @@ -137,3 +137,20 @@ if let enableFeatureX = pathConfiguration.settings["enable-feature-x"] as? Bool } ``` +### Swift Regex + +The Turbo IOS framework uses `NSRegularExpression` swift class to evaluate regex expressions. Something to note is you need to escape back slashes `\` becauses they are special charectars in Swift to do this add a second backslash `\\d` + +```json +[ + { + "patterns": [ + "/numbers/\\d+$" + ], + "properties": { + "view-controller": "numbersDetail", + "presentation": "modal" + } + }, +] +``` From f9792fa7ff249ab44bbcd06917f80d7c4b13374b Mon Sep 17 00:00:00 2001 From: Indigo Tech Date: Mon, 13 May 2024 23:26:26 -0500 Subject: [PATCH 2/2] fix wording typo --- Docs/PathConfiguration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/PathConfiguration.md b/Docs/PathConfiguration.md index 11f6f06..0004335 100644 --- a/Docs/PathConfiguration.md +++ b/Docs/PathConfiguration.md @@ -139,7 +139,7 @@ if let enableFeatureX = pathConfiguration.settings["enable-feature-x"] as? Bool ### Swift Regex -The Turbo IOS framework uses `NSRegularExpression` swift class to evaluate regex expressions. Something to note is you need to escape back slashes `\` becauses they are special charectars in Swift to do this add a second backslash `\\d` +The Turbo IOS framework uses `NSRegularExpression` swift class to evaluate regular expressions. Something to note is you need to escape back slashes `\` because it is a special charectars in Swift to do this add a second backslash `\\d` ```json [