diff --git a/content/en/docs/2023.11/Reference/Blocks/Text/find-text/find-text-block.md b/content/en/docs/2023.11/Reference/Blocks/Text/find-text/find-text-block.md index 5f87eaf3a..9006b7c7c 100644 --- a/content/en/docs/2023.11/Reference/Blocks/Text/find-text/find-text-block.md +++ b/content/en/docs/2023.11/Reference/Blocks/Text/find-text/find-text-block.md @@ -17,7 +17,7 @@ Finds the specified [Occurrence][Occurrence Property] of [Text To Find][TextToFi ## Examples -### Find the specified Occurrence of Text To Find (Ordinal) +### Find the first Occurrence of Text To Find (Ordinal) This example will find the first occurrence of `"The"` in `"The quick brown fox jumps over the lazy dog"`. @@ -29,7 +29,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text. |--------------------|---------------------------|------------------------------------------| | [Text][Text Property] | `($)Text`, with value `"The quick brown fox jumps over the lazy dog"` | `($)Text` is a variable of type [String][] | | [Text To Find][TextToFind Property] | `($)TextToFind`, with value `{"startsWith": "", "contains": "The", "endsWith": ""}`

In this example `($)TextToFind` has been set up using the following [Expression][]:

`new TextToFind(startsWith: "", contains: "The", endsWith:"")` | `($)TextToFind` is a variable of type [TextToFind][] | -| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `0` | `($)Occurrence` is a variable of type [Int32][] | +| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `1` | `($)Occurrence` is a variable of type [Int32][] | | [Search Options][SearchOptions Property] | `($)SearchOptions`, with value `SearchOptions.ContainsText` | `($)SearchOptions` is a variable of type [SearchOptions][] | | [Comparison Type][ComparisonType Property] | `($)ComparisonType`, with value `StringComparison.Ordinal` | `($)ComparisonType` is a variable of type [StringComparison][] | | [Match][Match Property] | `($)Match`, with no value | `($)Match` is a variable that will be set to an [Match][] value | @@ -74,7 +74,7 @@ As this example is performing a [case-sensitive, culture-insensitive][Ordinal] c *** -### Find the specified Occurrence of Text To Find (Ordinal Ignore Case) +### Find the second Occurrence of Text To Find (Ordinal Ignore Case) This example will find the second occurrence of `"The"` in `"The quick brown fox jumps over the lazy dog"`. @@ -86,7 +86,7 @@ It performs a [case-insensitive, culture-insensitive][OrdinalIgnoreCase] compari |--------------------|---------------------------|------------------------------------------| | [Text][Text Property] | `($)Text`, with value `"The quick brown fox jumps over the lazy dog"` | `($)Text` is a variable of type [String][] | | [Text To Find][TextToFind Property] | `($)TextToFind`, with value `{"startsWith": "", "contains": "The", "endsWith": ""}`

In this example `($)TextToFind` has been set up using the following [Expression][]:

`new TextToFind(startsWith: "", contains: "The", endsWith:"")` | `($)TextToFind` is a variable of type [TextToFind][] | -| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `1` | `($)Occurrence` is a variable of type [Int32][] | +| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `2` | `($)Occurrence` is a variable of type [Int32][] | | [Search Options][SearchOptions Property] | `($)SearchOptions`, with value `SearchOptions.ContainsText` | `($)SearchOptions` is a variable of type [SearchOptions][] | | [Comparison Type][ComparisonType Property] | `($)ComparisonType`, with value `StringComparison.OrdinalIgnoreCase` | `($)ComparisonType` is a variable of type [StringComparison][] | | [Match][Match Property] | `($)Match`, with no value | `($)Match` is a variable that will be set to an [Match][] value | @@ -131,7 +131,7 @@ As this example is performing a [case-insensitive, culture-insensitive][OrdinalI *** -### Find the last occurrence of Text To Find +### Find the last Occurrence of Text To Find This example will find the last occurrence of `"The"` in `"The quick brown fox jumps over the lazy dog"`. @@ -150,7 +150,7 @@ It performs a [case-insensitive, culture-insensitive][OrdinalIgnoreCase] compari #### Result -As this example is performing a [case-insensitive, culture-insensitive][OrdinalIgnoreCase] comparison of text, `"The quick brown fox jumps over the lazy dog"` contains the text `"The"` twice; the first occurrence is `"The"` and the second occurrence is `"the"`. As we are looking for [Occurrence][Occurrence Property] `-1`, we choose the last occurrence, and therefore, the variable `($)Match` will be set to the following: +As this example is performing a [case-insensitive, culture-insensitive][OrdinalIgnoreCase] comparison of text, `"The quick brown fox jumps over the lazy dog"` contains the text `"The"` twice; the first occurrence is `"The"` and the second occurrence is `"the"`. The second occurrence is the last occurrence, and therefore, the variable `($)Match` will be set to the following: ```json { @@ -188,9 +188,9 @@ As this example is performing a [case-insensitive, culture-insensitive][OrdinalI *** -### Find an invalid occurrence of Text To Find +### Find an invalid Occurrence of Text To Find -This example will find the third occurrence of `"The"` in `"The quick brown fox jumps over the lazy dog"`. +This example will find the third occurrence of `"The"`, which is not present, in `"The quick brown fox jumps over the lazy dog"`. It performs a [case-insensitive, culture-insensitive][OrdinalIgnoreCase] comparison of text. @@ -200,14 +200,14 @@ It performs a [case-insensitive, culture-insensitive][OrdinalIgnoreCase] compari |--------------------|---------------------------|------------------------------------------| | [Text][Text Property] | `($)Text`, with value `"The quick brown fox jumps over the lazy dog"` | `($)Text` is a variable of type [String][] | | [Text To Find][TextToFind Property] | `($)TextToFind`, with value `{"startsWith": "", "contains": "The", "endsWith": ""}`

In this example `($)TextToFind` has been set up using the following [Expression][]:

`new TextToFind(startsWith: "", contains: "The", endsWith:"")` | `($)TextToFind` is a variable of type [TextToFind][] | -| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `2` | `($)Occurrence` is a variable of type [Int32][] | +| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `3` | `($)Occurrence` is a variable of type [Int32][] | | [Search Options][SearchOptions Property] | `($)SearchOptions`, with value `SearchOptions.ContainsText` | `($)SearchOptions` is a variable of type [SearchOptions][] | | [Comparison Type][ComparisonType Property] | `($)ComparisonType`, with value `StringComparison.OrdinalIgnoreCase` | `($)ComparisonType` is a variable of type [StringComparison][] | | [Match][Match Property] | `($)Match`, with no value | `($)Match` is a variable that will be set to an [Match][] value | #### Result -As this example is performing a [case-insensitive, culture-insensitive][OrdinalIgnoreCase] comparison of text, `"The quick brown fox jumps over the lazy dog"` contains the text `"The"` twice; the first occurrence is `"The"` and the second occurrence is `"the"`. As we are looking for [Occurrence][Occurrence Property] `2`, and there are only 2 matches, there is not a valid match. Therefore, the variable `($)Match` will be set to the following: +As this example is performing a [case-insensitive, culture-insensitive][OrdinalIgnoreCase] comparison of text, `"The quick brown fox jumps over the lazy dog"` contains the text `"The"` twice; the first occurrence is `"The"` and the second occurrence is `"the"`. There is no match for the third [Occurrence][Occurrence Property]. Therefore, the variable `($)Match` will be set to the following: ```json null @@ -215,7 +215,7 @@ null *** -### Find the specified Occurrence that matches the pattern in Text To Find +### Find the first Occurrence that matches the pattern in Text To Find This example will find the first occurrence of text that match a pattern containing `"?he"` in `"The quick brown fox jumps over the lazy dog"`. @@ -227,7 +227,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text. |--------------------|---------------------------|------------------------------------------| | [Text][Text Property] | `($)Text`, with value `"The quick brown fox jumps over the lazy dog"` | `($)Text` is a variable of type [String][] | | [Text To Find][TextToFind Property] | `($)TextToFind`, with value `{"startsWith": "", "contains": "?he", "endsWith": ""}`

In this example `($)TextToFind` has been set up using the following [Expression][]:

`new TextToFind(startsWith: "", contains: "?he", endsWith:"")` | `($)TextToFind` is a variable of type [TextToFind][] | -| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `0` | `($)Occurrence` is a variable of type [Int32][] | +| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `1` | `($)Occurrence` is a variable of type [Int32][] | | [Search Options][SearchOptions Property] | `($)SearchOptions`, with value `SearchOptions.PatternMatching` | `($)SearchOptions` is a variable of type [SearchOptions][] | | [Comparison Type][ComparisonType Property] | `($)ComparisonType`, with value `StringComparison.Ordinal` | `($)ComparisonType` is a variable of type [StringComparison][] | | [Match][Match Property] | `($)Match`, with no value | `($)Match` is a variable that will be set to an [Match][] value | @@ -272,7 +272,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text. *** -### Find the specified Occurrence that matches the regex in Text To Find +### Find the first Occurrence that matches the regex in Text To Find This example will find the first occurrence of text that match the regex `"^The"` from `"The quick brown fox jumps over the lazy dog"`. @@ -284,7 +284,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text. |--------------------|---------------------------|------------------------------------------| | [Text][Text Property] | `($)Text`, with value `"The quick brown fox jumps over the lazy dog"` | `($)Text` is a variable of type [String][] | | [Text To Find][TextToFind Property] | `($)TextToFind`, with value `{"startsWith": "", "contains": "^The", "endsWith": ""}`

In this example `($)TextToFind` has been set up using the following [Expression][]:

`new TextToFind(startsWith: "", contains: "^The", endsWith:"")` | `($)TextToFind` is a variable of type [TextToFind][] | -| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `0` | `($)Occurrence` is a variable of type [Int32][] | +| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `1` | `($)Occurrence` is a variable of type [Int32][] | | [Search Options][SearchOptions Property] | `($)SearchOptions`, with value `SearchOptions.Regex` | `($)SearchOptions` is a variable of type [SearchOptions][] | | [Comparison Type][ComparisonType Property] | `($)ComparisonType`, with value `StringComparison.Ordinal` | `($)ComparisonType` is a variable of type [StringComparison][] | | [Match][Match Property] | `($)Match`, with no value | `($)Match` is a variable that will be set to an [Match][] value | @@ -329,7 +329,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text. *** -### Find the specified Occurrence that starts with and ends with a Text To Find in Text +### Find the first Occurrence that starts with and ends with a Text To Find in Text This example will find the first occurrence of text that starts with `"The"` and ends with `"jumps"` from `"The quick brown fox jumps over the lazy dog."`. @@ -341,14 +341,14 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text. |--------------------|---------------------------|------------------------------------------| | [Text][Text Property] | `($)Text`, with value `"The quick brown fox jumps over the lazy dog"` | `($)Text` is a variable of type [String][] | | [Text To Find][TextToFind Property] | `($)TextToFind`, with value `{"startsWith": "The", "contains": "", "endsWith": "jumps"}`

In this example `($)TextToFind` has been set up using the following [Expression][]:

`new TextToFind(startsWith: "The", contains: "", endsWith:"jumps")` | `($)TextToFind` is a variable of type [TextToFind][] | -| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `0` | `($)Occurrence` is a variable of type [Int32][] | +| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `1` | `($)Occurrence` is a variable of type [Int32][] | | [Search Options][SearchOptions Property] | `($)SearchOptions`, with value `SearchOptions.ContainsText` | `($)SearchOptions` is a variable of type [SearchOptions][] | | [Comparison Type][ComparisonType Property] | `($)ComparisonType`, with value `StringComparison.Ordinal` | `($)ComparisonType` is a variable of type [StringComparison][] | | [Match][Match Property] | `($)Match`, with no value | `($)Match` is a variable that will be set to an [Match][] value | #### Result -`"The quick brown fox jumps over the lazy dog"` contains 1 occurrence starting with `"The"` and ending with `"jumps"`, which is `"The quick brown fox jumps"` Therefore, the variable `($)Match` will be set to the following: +`"The quick brown fox jumps over the lazy dog"` contains one occurrence starting with `"The"` and ending with `"jumps"`, which is `"The quick brown fox jumps"` Therefore, the variable `($)Match` will be set to the following: ```json { @@ -398,7 +398,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text. *** -### Find the specified Occurrence that starts with and ends with a Text To Find in Text (Null contains) +### Find the first Occurrence that starts with and ends with a Text To Find in Text (Null contains) This example will find the first occurrence of text that start with `"The"`, contains `null` and ends with `"jumps"` from `"The quick brown fox jumps over the lazy dog."`. To clarify, this [Text To Find][TextToFind Property] input is searching for matches of `"Thejumps"` exactly in [Text][Text Property]. @@ -410,7 +410,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text. |--------------------|---------------------------|------------------------------------------| | [Text][Text Property] | `($)Text`, with value `"The quick brown fox jumps over the lazy dog."` | `($)Text` is a variable of type [String][] | | [Text To Find][TextToFind Property] | `($)TextToFind`, with value `{"startsWith": "The", "contains": null, "endsWith": "jumps"}`

In this example `($)TextToFind` has been set up using the following [Expression][]:

`new TextToFind(startsWith: "The", contains: null, endsWith:"jumps")` | `($)TextToFind` is a variable of type [TextToFind][] | -| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `0` | `($)Occurrence` is a variable of type [Int32][] | +| [Occurrence][Occurrence Property] | `($)Occurrence`, with value `1` | `($)Occurrence` is a variable of type [Int32][] | | [Search Options][SearchOptions Property] | `($)SearchOptions`, with value `SearchOptions.ContainsText` | `($)SearchOptions` is a variable of type [SearchOptions][] | | [Comparison Type][ComparisonType Property] | `($)ComparisonType`, with value `StringComparison.Ordinal` | `($)ComparisonType` is a variable of type [StringComparison][] | | [Match][Match Property] | `($)Match`, with no value | `($)Match` is a variable that will be set to an [Match][] value | @@ -552,16 +552,16 @@ If all properties of [Text To Find][TextToFind Property] are `null` or empty (i. ### Null or empty property of Text To Find -If at least one, but not all properties of [Text To Find][TextToFind Property] are `null` or empty (i.e. `""`), then that section of the query is not included as a specific [Group][] in the returned [Match][]; see [Find the specified Occurrence that starts with and ends with a Text To Find in Text][]. +If at least one, but not all properties of [Text To Find][TextToFind Property] are `null` or empty (i.e. `""`), then that section of the query is not included as a specific [Group][] in the returned [Match][]; see [Find the first Occurrence that starts with and ends with a Text To Find in Text][]. There exist two special cases involving the [Contains][] nested property of [Text To Find][TextToFind Property]; see below. #### Empty contains property of Text To Find -If the [Contains][] nested property of [Text To Find][TextToFind Property] is empty (i.e. `""`), and both the [StartsWith][] and [EndsWith][] nested properties are not null, then a valid match will be one starting with [StartsWith][], and ending with [EndsWith][], including any content between the two groups; see [Find the specified Occurrence that starts with and ends with a Text To Find in Text][]. +If the [Contains][] nested property of [Text To Find][TextToFind Property] is empty (i.e. `""`), and both the [StartsWith][] and [EndsWith][] nested properties are not null, then a valid match will be one starting with [StartsWith][], and ending with [EndsWith][], including any content between the two groups; see [Find the first Occurrence that starts with and ends with a Text To Find in Text][]. #### Null contains property of Text To Find -If the [Contains][] nested property of [Text To Find][TextToFind Property] is `null`, and both the [StartsWith][] and [EndsWith][] nested properties are not null, then a valid match will be one starting with [StartsWith][], and ending with [EndsWith][], with no content between the two groups, i.e. an exact match only; see [Find the specified Occurrence that starts with and ends with a Text To Find in Text (Null contains)][]. +If the [Contains][] nested property of [Text To Find][TextToFind Property] is `null`, and both the [StartsWith][] and [EndsWith][] nested properties are not null, then a valid match will be one starting with [StartsWith][], and ending with [EndsWith][], with no content between the two groups, i.e. an exact match only; see [Find the first Occurrence that starts with and ends with a Text To Find in Text (Null contains)][]. ### Known Limitations @@ -573,8 +573,8 @@ If [Search Options][SearchOptions Property] is set to `SearchOptions.Regex` or ` [TextToFind Property]: {{< ref "#text-to-find" >}} [SearchOptions Property]: {{< ref "#search-options" >}} [ComparisonType Property]: {{< ref "#comparison-type" >}} -[Find the specified Occurrence that starts with and ends with a Text To Find in Text]: {{}} -[Find the specified Occurrence that starts with and ends with a Text To Find in Text (Null contains)]: {{}} +[Find the first Occurrence that starts with and ends with a Text To Find in Text]: {{}} +[Find the first Occurrence that starts with and ends with a Text To Find in Text (Null contains)]: {{}} [Input]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.WhatIsABlockProperty.Input" >}} [InputOutput]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.WhatIsABlockProperty.InputOutput" >}} diff --git a/content/en/docs/2023.11/Reference/data-types/collections/ireadonlylist-1.md b/content/en/docs/2023.11/Reference/data-types/collections/ireadonlylist-1.md new file mode 100644 index 000000000..fc05b4734 --- /dev/null +++ b/content/en/docs/2023.11/Reference/data-types/collections/ireadonlylist-1.md @@ -0,0 +1,7 @@ +--- +title: "IReadOnlyList" +linkTitle: "IReadOnlyList" +description: "" +--- + +{{}} \ No newline at end of file diff --git a/content/en/docs/2023.11/Reference/data-types/text/regex/capturedetails.md b/content/en/docs/2023.11/Reference/data-types/text/regex/capturedetails.md index e7b78590a..f1aae5ce8 100644 --- a/content/en/docs/2023.11/Reference/data-types/text/regex/capturedetails.md +++ b/content/en/docs/2023.11/Reference/data-types/text/regex/capturedetails.md @@ -14,11 +14,11 @@ The `CaptureDetails` data type is used to represent a single capture for a given | | | |-|-| -| **Category:** | Regex | +| **Category:** | Text | | **Name:** | `CaptureDetails` | | **Full Name:** | `Cortex.DataTypes.Text.Regex.CaptureDetails` | | **Alias:** | N/A | -| **Description:** | A single capture for a given group. | +| **Description:** | A `CaptureDetails` represents a single capture for a given [Group][]. | | **Default Value:** | null | | **Can be used as:** | `CaptureDetails`, `Object`, `dynamic` | | **Can be cast to:** | N/A | @@ -27,7 +27,7 @@ The `CaptureDetails` data type is used to represent a single capture for a given ### Value -The value of this capture. +The value of the capture. | | | |--------------------|---------------------------| @@ -38,7 +38,7 @@ The value of this capture. ### Index -The starting index of this capture in the input text. +The starting index of the capture. | | | |--------------------|---------------------------| @@ -49,7 +49,7 @@ The starting index of this capture in the input text. ### Length -The length of the capture. +The length of the [Value][Value Property]. | | | |--------------------|---------------------------| @@ -66,23 +66,29 @@ The following table shows some of the ways that a `CaptureDetails` can be create | Method | Example | Result | Editor Support | Notes | |-|-|-|-|-| -| Construct `CaptureDetails` | `new CaptureDetails{Value = "", Index = 0, Length = 0}` | `{"Value": "","Index": 0,"Length": 0}` | Expression | No proper constructor exists for this data type. | +| Use a `CaptureDetails` constructor with object initialisation | `new CaptureDetails{Value = "", Index = 0, Length = 0}` | `{"Value": "","Index": 0,"Length": 0}` | Expression | | -### Convert a Group to Text +### Convert a CaptureDetails to Text | Method | Example | Result | Editor Support | Notes | |-|-|-|-|-| +| Use `ToString` | `($)CaptureDetails.ToString()` | `"Cortex.DataTypes.Text.Regex.CaptureDetails"` | Expression | ToString will return the Full Name of the `CaptureDetails` Data Type | +| Use `Convert Object to Text` block | where `Object` property has a value of `{"Value": "","Index": 0,"Length": 0}` | `"Cortex.DataTypes.Text.Regex.CaptureDetails"` | N/A | See [Convert Object to Text][] | | Use `Convert Object to Json` block | where `Object` property has a value of `{"Value": "","Index": 0,"Length": 0}` | `"{\r\n \"Value\": \"\",\r\n \"Index\": 0,\r\n \"Length\": 0\r\n}"` | N/A | See [Convert Object to Json][] | ### Property Editor Support - The Expression Editor is available for [Input][] properties where the data type is `CaptureDetails`. -- The Literal Editor is available for [Input][] properties where the data type is `CaptureDetails`. +- The Literal Editor is not available for [Input][] properties where the data type is `CaptureDetails`. - The Variable Editor is available for [Input][], [InputOutput][] and [Output][] properties where the data type is `CaptureDetails`. ### Known Limitations -None +#### ToString Method always returns the Full Name + +Currently, if the `ToString()` method is used on a `CaptureDetails`, then its Full Name will be returned; instead of a representation of the data within the `CaptureDetails`. + +In future this limitation may be removed. ## See Also @@ -98,7 +104,11 @@ None ### External Documentation -* [System.Text.RegularExpressions.Capture][] +None + +[Value Property]: {{}} +[Index Property]: {{}} +[Length Property]: {{}} [Input]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.WhatIsABlockProperty.Input" >}} [Output]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.WhatIsABlockProperty.Output" >}} @@ -114,5 +124,6 @@ None [String]: {{< url path="Cortex.Reference.DataTypes.Text.String.MainDoc" >}} [Convert Object To Json]: {{< url path="Cortex.Reference.Blocks.Json.ConvertJson.ConvertObjectToJson.MainDoc" >}} +[Convert Object To Text]: {{< url path="Cortex.Reference.Blocks.Objects.ConvertObject.ConvertObjectToText.MainDoc" >}} [Working with Text]: {{< url path="Cortex.Reference.Concepts.WorkingWith.Text.MainDoc" >}} diff --git a/content/en/docs/2023.11/Reference/data-types/text/regex/group.md b/content/en/docs/2023.11/Reference/data-types/text/regex/group.md index 447e31c3d..1b11e02e1 100644 --- a/content/en/docs/2023.11/Reference/data-types/text/regex/group.md +++ b/content/en/docs/2023.11/Reference/data-types/text/regex/group.md @@ -10,15 +10,15 @@ description: "Used to represent a regex match group. It contains all of the capt ## Summary -The `Group` data type is used to represent a [regex match][Match] group. It contains all of the [Captures][CaptureDetails] for a given group pattern. +The `Group` data type is used to represent a regex [Match][] group. It contains all of the [Captures][CaptureDetails] for a given group pattern. | | | |-|-| -| **Category:** | Regex | +| **Category:** | Text | | **Name:** | `Group` | | **Full Name:** | `Cortex.DataTypes.Text.Regex.Group` | | **Alias:** | N/A | -| **Description:** | A regex match group. | +| **Description:** | A `Group` represents a regex [Match][] group. It contains all of the [Captures][CaptureDetails] for a given group pattern. | | **Default Value:** | null | | **Can be used as:** | `Group`, `Object`, `dynamic` | | **Can be cast to:** | N/A | @@ -27,7 +27,7 @@ The `Group` data type is used to represent a [regex match][Match] group. It cont ### Value -The Value is the value of the last [capture][CaptureDetails] for this group. +The value of the last [CaptureDetails][] within [Captures][Captures Property], this represents the full text captured by the Group. | | | |--------------------|---------------------------| @@ -38,7 +38,7 @@ The Value is the value of the last [capture][CaptureDetails] for this group. ### Index -The starting index of the first [capture][CaptureDetails] for this group in the input text. +The starting index of the first [CaptureDetails][] within [Captures][Captures Property]. | | | |--------------------|---------------------------| @@ -49,7 +49,7 @@ The starting index of the first [capture][CaptureDetails] for this group in the ### Length -The length of the matched group text. +The length of [Value][Value Property]. | | | |--------------------|---------------------------| @@ -60,14 +60,15 @@ The length of the matched group text. ### Captures -The list of [captures][CaptureDetails] found for this regex match group. If there were no captures, this is an empty list. +The list of [CaptureDetails][CaptureDetails] found in the Group. +

If no captures were found, the list will be empty. | | | |--------------------|---------------------------| -| Data Type | IReadOnlyList<[CaptureDetails][]> | +| Data Type | [IReadOnlyList]<[CaptureDetails][]> | | Is [Advanced][] | `false` | | Default Editor | [Expression][] | -| Default Value | IReadOnlyList<[CaptureDetails][]> with no value | +| Default Value | [IReadOnlyList][]<[CaptureDetails][]> with no value | ## Remarks @@ -77,30 +78,36 @@ The following table shows some of the ways that a `Group` can be created. | Method | Example | Result | Editor Support | Notes | |-|-|-|-|-| -| Construct `Group` | `new Group{Value = "", Index = 0, Length = 0, Captures = new List()}` | `{"Value": "","Index": 0,"Length": 0,"Captures": []}` | Expression | No proper constructor exists for this data type. | +| Use a `Group` constructor with object initialisation | `new Group{Value = "", Index = 0, Length = 0, Captures = new List()}` | `{"Value": "","Index": 0,"Length": 0,"Captures": []}` | Expression | | ### Convert a Group to Text | Method | Example | Result | Editor Support | Notes | |-|-|-|-|-| +| Use `ToString` | `($)Group.ToString()` | `"Cortex.DataTypes.Text.Regex.Group"` | Expression | ToString will return the Full Name of the `Group` Data Type | +| Use `Convert Object to Text` block | where `Object` property has a value of `{"Value": "","Index": 0,"Length": 0,"Captures": new List()}` | `"Cortex.DataTypes.Text.Regex.Group"` | N/A | See [Convert Object to Text][] | | Use `Convert Object to Json` block | where `Object` property has a value of `{"Value": "","Index": 0,"Length": 0,"Captures": []}` | `"{\r\n \"Value\": \"\",\r\n \"Index\": 0,\r\n \"Length\": 0,\r\n \"Captures\": []\r\n}"` | N/A | See [Convert Object to Json][] | ### Property Editor Support - The Expression Editor is available for [Input][] properties where the data type is `Group`. -- The Literal Editor is available for [Input][] properties where the data type is `Group`. +- The Literal Editor is not available for [Input][] properties where the data type is `Group`. - The Variable Editor is available for [Input][], [InputOutput][] and [Output][] properties where the data type is `Group`. ### Known Limitations -None +#### ToString Method always returns the Full Name + +Currently, if the `ToString()` method is used on a `Group`, then its Full Name will be returned; instead of a representation of the data within the `Group`. + +In future this limitation may be removed. ## See Also ### Related Data Types * [CaptureDetails][] -* IReadOnlyList +* [IReadOnlyList][] * [Int32][] * [Match][] * [String][] @@ -111,7 +118,10 @@ None ### External Documentation -* [System.Text.RegularExpressions.Group][] +None + +[Captures Property]: {{}} +[Value Property]: {{}} [Input]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.WhatIsABlockProperty.Input" >}} [Output]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.WhatIsABlockProperty.Output" >}} @@ -123,11 +133,13 @@ None [System.Text.RegularExpressions.Group]: {{< url path="MSDocs.DotNet.Api.System.Text.RegularExpressions.Group" >}} [CaptureDetails]: {{}} +[IReadOnlyList]: {{}} [Dictionary]: {{}} [Int32]: {{}} [Match]: {{}} [String]: {{< url path="Cortex.Reference.DataTypes.Text.String.MainDoc" >}} [Convert Object To Json]: {{< url path="Cortex.Reference.Blocks.Json.ConvertJson.ConvertObjectToJson.MainDoc" >}} +[Convert Object To Text]: {{< url path="Cortex.Reference.Blocks.Objects.ConvertObject.ConvertObjectToText.MainDoc" >}} [Working with Text]: {{< url path="Cortex.Reference.Concepts.WorkingWith.Text.MainDoc" >}} diff --git a/content/en/docs/2023.11/Reference/data-types/text/regex/match.md b/content/en/docs/2023.11/Reference/data-types/text/regex/match.md index edba589ed..2471f9adb 100644 --- a/content/en/docs/2023.11/Reference/data-types/text/regex/match.md +++ b/content/en/docs/2023.11/Reference/data-types/text/regex/match.md @@ -14,11 +14,11 @@ The `Match` data type is used to represent a regex match. It contains all of the | | | |-|-| -| **Category:** | Regex | +| **Category:** | Text | | **Name:** | `Match` | | **Full Name:** | `Cortex.DataTypes.Text.Regex.Match` | | **Alias:** | N/A | -| **Description:** | A regex match. | +| **Description:** | A `Match` represents a regex match. It contains all of the [Groups][Group] found in the regex pattern. | | **Default Value:** | null | | **Can be used as:** | `Match`, `Object`, `dynamic` | | **Can be cast to:** | N/A | @@ -27,7 +27,7 @@ The `Match` data type is used to represent a regex match. It contains all of the ### Value -The value of the full match. +The value of the text that was matched | | | |--------------------|---------------------------| @@ -38,7 +38,7 @@ The value of the full match. ### Index -The starting index of the regex match in the input text. +The starting index of the regex match. | | | |--------------------|---------------------------| @@ -49,7 +49,7 @@ The starting index of the regex match in the input text. ### Length -The length of this regex match. +The length of [Value][Value Property]. | | | |--------------------|---------------------------| @@ -60,7 +60,9 @@ The length of this regex match. ### Groups -The dictionary of [Groups][Group] in this match. The key [String][] is the [Group][] name. The default group `0` is always included for a valid match, and contains the whole [Value][Value Property] as its value. Unnamed groups will have keys starting from `"1"`, `"2"`, etc. +The dictionary of [Groups][Group] in the match.

Each key in [Groups][Groups Property] represents the name of the [Group][], if a group does not have a name provided they will increment from `"1"` + +[Groups][Groups Property] always contains a default [Group][] representing the full match, the name of this [Group][] is always `"0"`. | | | |--------------------|---------------------------| @@ -77,23 +79,29 @@ The following table shows some of the ways that a `Match` can be created. | Method | Example | Result | Editor Support | Notes | |-|-|-|-|-| -| Construct `Match` | `new Match{Value = "", Index = 0, Length = 0, Groups = {}}` | `{"Value": "","Index": 0,"Length": 0,"Groups": {}}` | Expression | | +| Use a `Match` constructor with object initialisation | `new Match{Value = "", Index = 0, Length = 0, Groups = new Dictionary()}` | `{"Value": "","Index": 0,"Length": 0,"Groups": {}}` | Expression | | ### Convert Match to Text | Method | Example | Result | Editor Support | Notes | |-|-|-|-|-| +| Use `ToString` | `($)Match.ToString()` | `"Cortex.DataTypes.Text.Regex.Match"` | Expression | ToString will return the Full Name of the `Match` Data Type | +| Use `Convert Object to Text` block | where `Object` property has a value of `{"Value": "","Index": 0,"Length": 0,"Groups": {}}` | `"Cortex.DataTypes.Text.Regex.Match"` | N/A | See [Convert Object to Text][] | | Use `Convert Object to Json` block | where `Object` property has a value of `{"Value": "","Index": 0,"Length": 0,"Groups": {}}` | `"{\r\n \"Value\": \"\",\r\n \"Index\": 0,\r\n \"Length\": 0,\r\n \"Groups\": {}\r\n}"` | N/A | See [Convert Object to Json][] | ### Property Editor Support - The Expression Editor is available for [Input][] properties where the data type is `Match`. -- The Literal Editor is available for [Input][] properties where the data type is `Match`. +- The Literal Editor is not available for [Input][] properties where the data type is `Match`. - The Variable Editor is available for [Input][], [InputOutput][] and [Output][] properties where the data type is `Match`. ### Known Limitations -None +#### ToString Method always returns the Full Name + +Currently, if the `ToString()` method is used on a `Match`, then its Full Name will be returned; instead of a representation of the data within the `Match`. + +In future this limitation may be removed. ## See Also @@ -110,8 +118,9 @@ None ### External Documentation -* [System.Text.RegularExpressions.Match][] +None +[Groups Property]: {{}} [Value Property]: {{}} [Input]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.WhatIsABlockProperty.Input" >}} @@ -129,5 +138,6 @@ None [Group]: {{}} [Convert Object To Json]: {{< url path="Cortex.Reference.Blocks.Json.ConvertJson.ConvertObjectToJson.MainDoc" >}} +[Convert Object To Text]: {{< url path="Cortex.Reference.Blocks.Objects.ConvertObject.ConvertObjectToText.MainDoc" >}} [Working with Text]: {{< url path="Cortex.Reference.Concepts.WorkingWith.Text.MainDoc" >}} diff --git a/data/urls.toml b/data/urls.toml index 2203608be..6a7c4e331 100644 --- a/data/urls.toml +++ b/data/urls.toml @@ -1313,6 +1313,8 @@ MainDoc = "/docs/reference/data-types/collections/ienumerable-1" [Cortex.Reference.DataTypes.Collections.IList] MainDoc = "/docs/reference/data-types/collections/ilist-1" + [Cortex.Reference.DataTypes.Collections.IReadOnlyList] + MainDoc = "/docs/reference/data-types/collections/ireadonlylist-1" [Cortex.Reference.DataTypes.Collections.List] MainDoc = "/docs/reference/data-types/collections/list-1" CreateNew = "/docs/reference/data-types/collections/list-1#create-a-listlttitemgt"