Skip to content

Commit

Permalink
signoff changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cortex-av committed Nov 2, 2023
1 parent 66578d9 commit 88e8f85
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text.

#### Result

`"The quick brown fox jumps over the lazy dog"` contains 1 sequence starting with `"The"` and ending with `"jumps"`, which is `"The quick brown fox jumps"` Therefore, the variable `($)Matches` will be set to the following:
`"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 `($)Matches` will be set to the following:

```json
[
Expand Down Expand Up @@ -399,7 +399,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text.

#### Result

`"The quick brown fox jumps over the lazy dog. The dog woke up and tried to bite the fox. The fox jumps to get away."` has 0 sequences starting with `"The"` and ending with `"jumps"`, as [Contains][] being `null` will require an exact match for [Text to Find][TextToFind Property] in [Text][Text Property]. Therefore, the variable `($)Matches` will be set to the following:
`"The quick brown fox jumps over the lazy dog. The dog woke up and tried to bite the fox. The fox jumps to get away."` has 0 occurrences starting with `"The"` and ending with `"jumps"`, as [Contains][] being `null` will require an exact match for [Text to Find][TextToFind Property] in [Text][Text Property]. Therefore, the variable `($)Matches` will be set to the following:

```json
[]
Expand Down Expand Up @@ -520,15 +520,15 @@ 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 all occurrences that start with and end 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.
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 properly defined, then a valid match will be one starting with [StartsWith][], and ending with [EndsWith][], including and regardless of any content between the two; see [Find all occurrences that start with and end 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 of any content between the two groups; see [Find all occurrences that start with and end 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 properly defined, then a valid match will be one starting with [StartsWith][], and ending with [EndsWith][], with no content allowed between the two, i.e. an exact match only; see [Find all occurrences that start with and end 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 all occurrences that start with and end with a Text To Find in Text (Null contains)][].

### Known Limitations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ description: "Finds the specified occurrence of a text in a given text."

## Description

Finds the nth of [Text To Find][TextToFind Property] in a given [Text][Text Property].
Finds the specified [Occurrence][Occurrence Property] of [Text To Find][TextToFind Property] in a given [Text][Text Property].

[Search Options][SearchOptions Property] can be specified to choose whether to use a ContainsText, PatternMatching or Regex search to match the [Text To Find][TextToFind Property] input.

## Examples

### Find the nth occurrence of Text To Find (Ordinal)
### Find the specified 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"`.

Expand Down Expand Up @@ -74,7 +74,7 @@ As this example is performing a [case-sensitive, culture-insensitive][Ordinal] c

***

### Find the nth occurrence of Text To Find (Ordinal Ignore Case)
### Find the specified 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"`.

Expand Down Expand Up @@ -207,15 +207,15 @@ 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] `2`, and there are only 2 matches, we cannot return 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"`. 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:

```json
null
```

***

### Find the nth occurrence that matches the pattern in Text To Find
### Find the specified 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"`.

Expand Down Expand Up @@ -272,7 +272,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text.

***

### Find the nth occurrence that matches the regex in Text To Find
### Find the specified 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"`.

Expand Down Expand Up @@ -329,7 +329,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text.

***

### Find the nth 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

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."`.

Expand All @@ -348,7 +348,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text.

#### Result

`"The quick brown fox jumps over the lazy dog"` contains 1 sequence 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 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:

```json
{
Expand Down Expand Up @@ -398,7 +398,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text.

***

### Find the nth occurrence that starts with and ends with a Text To Find in Text (Null contains)
### Find the specified 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].

Expand All @@ -417,7 +417,7 @@ It performs a [case-sensitive, culture-insensitive][Ordinal] comparison of text.

#### Result

`"The quick brown fox jumps over the lazy dog."` has 0 sequences starting with `"The"` and ending with `"jumps"`, as [Contains][] being `null` will require an exact match for [Text to Find][TextToFind Property] in [Text][Text Property]. Therefore, the variable `($)Match` will be set to the following:
`"The quick brown fox jumps over the lazy dog."` has 0 occurrences starting with `"The"` and ending with `"jumps"`, as [Contains][] being `null` will require an exact match for [Text to Find][TextToFind Property] in [Text][Text Property]. Therefore, the variable `($)Match` will be set to the following:

```json
null
Expand All @@ -429,7 +429,7 @@ null

### Text

The [Text][Text Property] to find the nth occurrence of [Text To Find][TextToFind Property] in.
The [Text][Text Property] to find the specified occurrence of [Text To Find][TextToFind Property] in.

| | |
|--------------------|---------------------------|
Expand All @@ -441,7 +441,7 @@ The [Text][Text Property] to find the nth occurrence of [Text To Find][TextToFin

### Text To Find

The [Text To Find][TextToFind Property] search query to find the nth occurrence of in [Text][Text Property]. This property contains all of the information in relation to the conditions for a valid match; these are:
The [Text To Find][TextToFind Property] search query to find the specified occurrence of in [Text][Text Property]. This property contains all of the information in relation to the conditions for a valid match; these are:

* [Starts With][StartsWith]
* [Contains][Contains]
Expand All @@ -465,7 +465,7 @@ The [Text To Find][TextToFind Property] search query to find the nth occurrence

### Occurrence

The [Occurrence][Occurrence Property] of [Text To Find][TextToFind Property] in [Text][Text Property]. A value of `0` refers to the first occurrence, a value of `1` to the second occurrence and a value of `-1` to the last occurrence.
The [Occurrence][Occurrence Property] of [Text To Find][TextToFind Property] in [Text][Text Property].

For information about [supported values][Occurrences] for the [Occurrence][Occurrence Property] property and examples of how it can be used, please see [Occurrences][].

Expand Down Expand Up @@ -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 nth 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 specified 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 properly defined, then a valid match will be one starting with [StartsWith][], and ending with [EndsWith][], including and regardless of any content between the two; see [Find the nth 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 specified 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 properly defined, then a valid match will be one starting with [StartsWith][], and ending with [EndsWith][], with no content allowed between the two, i.e. an exact match only; see [Find the nth 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 specified Occurrence that starts with and ends with a Text To Find in Text (Null contains)][].

### Known Limitations

Expand All @@ -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 nth occurrence that starts with and ends with a Text To Find in Text]: {{<ref "#find-the-nth-occurrence-that-starts-with-and-ends-with-a-text-to-find-in-text">}}
[Find the nth occurrence that starts with and ends with a Text To Find in Text (Null contains)]: {{<ref "#find-the-nth-occurrence-that-starts-with-and-ends-with-a-text-to-find-in-text-null-contains">}}
[Find the specified Occurrence that starts with and ends with a Text To Find in Text]: {{<ref "#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)]: {{<ref "#find-the-specified-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" >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ TODO
- How are they accessed?
- Positive or Negative int properties on blocks that operate on single items
- Difference between occurrence and indexes
- specified occurrence

## Positive Occurrences

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Regex"
linkTitle: "Regex"
description: "Data types used for mirroring .NET Regex data types"
description: "Used to represent Regex data types"
weight: 1
---
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "CaptureDetails"
linkTitle: "CaptureDetails"
description: "Used to represent a capture within a group within a match for a text search performed by the Find Text and Find All Text sets of blocks."
description: "Used to represent a single capture for a given group"
---

# {{% param title %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Group"
linkTitle: "Group"
description: "Used to represent a group within a match for a text search performed by the Find Text and Find All Text sets of blocks."
description: "Used to represent a regex match group. It contains all of the captures for a given group pattern."
---

# {{% param title %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Match"
linkTitle: "Match"
description: "Used to represent a text matching a text search performed by the Find Text and Find All Text sets of blocks"
description: "Used to represent a regex match. It contains all of the groups found in the regex pattern."
---

# {{% param title %}}
Expand Down
26 changes: 10 additions & 16 deletions content/en/docs/2023.11/Reference/data-types/text/texttofind.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "TextToFind"
linkTitle: "TextToFind"
description: "Used to represent a search query for FindText blocks."
description: "Used to represent a search query for finding text."
---

# {{% param title %}}
Expand All @@ -10,7 +10,7 @@ description: "Used to represent a search query for FindText blocks."

## Summary

The `TextToFind` data type is used to represent a search query for finding text in another body of text. It specifies what a valid [match][Match] should start, contain and end with.
The `TextToFind` data type is used to represent a search query for finding text.<br><br>It specifies what a valid [match][Match] should start, contain and end with.

| | |
|-|-|
Expand All @@ -27,9 +27,7 @@ The `TextToFind` data type is used to represent a search query for finding text

### Starts With

[Starts With][StartsWith Property] is used to define the string a valid match should start with.

This property is not required.
[Starts With][StartsWith Property] is used to define the [String][] a valid match should start with.

| | |
|--------------------|---------------------------|
Expand All @@ -40,9 +38,7 @@ This property is not required.

### Contains

[Contains][Contains Property] is used to define the string a valid match should contain.

This property is not required.
[Contains][Contains Property] is used to define the [String][] a valid match should contains between [Starts With][StartsWith Property] and [Ends With][EndsWith Property].

| | |
|--------------------|---------------------------|
Expand All @@ -53,9 +49,7 @@ This property is not required.

### Ends With

[Ends With][EndsWith Property] is used to define the string a valid match should end with.

This property is not required.
[Ends With][EndsWith Property] is used to define the [String][] a valid match should end with.

| | |
|--------------------|---------------------------|
Expand All @@ -72,17 +66,17 @@ The following table shows some of the ways that a `TextToFind` can be created.

| Method | Example | Result | Editor&nbsp;Support | Notes |
|-|-|-|-|-|
| Use a `TextToFind` constructor | `new TextToFind(startsWith: "the", contains: "quick", endsWith: "fox")`| `{"StartsWith":"the", "Contains":"quick", "EndsWith":"fox"}` | Expression | All fields specified ||
| Use a `TextToFind` constructor | `new TextToFind(startsWith: "the", contains: "quick", endsWith: "fox")`| `{"StartsWith":"the", "Contains":"quick", "EndsWith":"fox"}` | Expression | ||

A `TextToFind` can also be created using the Literal Editor by filling in the necessary values for the following properties:

| Property | Data Type | Example | Notes |
|-|-|-|-|
| `Starts With` | `String` | `"the"` | [Starts With][StartsWith Property] defines the string a valid match should start with. |
| `StartsWith` | `String` | `"the"` | [Starts With][StartsWith Property] defines the string a valid match should start with. |
| `Contains` | `String` | `"quick"` | [Contains][Contains Property] defines the string a valid match should contain. |
| `Ends With` | `String` | `"fox"` | [Ends With][EndsWith Property] defines the string a valid match should end with. |
| `EndsWith` | `String` | `"fox"` | [Ends With][EndsWith Property] defines the string a valid match should end with. |

### Convert EmailAddress to Text
### Convert TextToFind to Text

| Method | Example | Result | Editor&nbsp;Support | Notes |
|-|-|-|-|-|
Expand All @@ -102,7 +96,7 @@ None

### Related Data Types

None
* [String][]

### Related Concepts

Expand Down

0 comments on commit 88e8f85

Please sign in to comment.