You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/howto/search/replacement_expression_syntax.md
+3-6Lines changed: 3 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -23,10 +23,10 @@ the **Replace** dialog box and in the **Replace in Files** dialog box.
23
23
|\\NC | Forces all subsequent substituted characters to converted using [Unicode Normalization Form KC (Compatibility Composition)](../../cmd/convert/unicode_norm_fkc). |
24
24
|\\ND | Forces all subsequent substituted characters to be converted using [Unicode Normalization Form KD (Compatibility Decomposition)](../../cmd/convert/unicode_norm_fkd). |
25
25
|\\E | Turns off previous \\L, \\U, \\F, \\H, \\Nc, \\Nd, \\NC, or \\ND. |
26
-
| \\J | Specifies that JavaScript is used as the expression. \\J must be placed at the beginning of the replacement expression. Can be combined with back references. The **cell** function can also be used in the script. See {ref}`cell-function-beta`.
26
+
| \\J | Specifies that JavaScript is used as the expression. \\J must be placed at the beginning of the replacement expression. Can be combined with back references. The **cell** function can also be used in the script. See [cell function (beta)](replacement_expression_syntax#cell-function-beta).
27
27
|\\V | Same as \\J except that \\V uses the **V8 JavaScript** engine instead of the **Chakra** engine. |
28
-
| \\D | If the Date/Time type of a [**Number Range Expression**](number_range_syntax) is used to match a string, this expression specifies a date format. It can be combined with **\\T**. [See available day, month, and year format pictures.](https://docs.microsoft.com/en-us/windows/win32/intl/day--month--year--and-era-format-pictures) See {ref}`date-format-example`
29
-
| \\T | If the Date/Time type of a [**Number Range Expression**](number_range_syntax) is used to match a string, this expression specifies a time format. It can be combined with **\\D**. [See available hour, minute, and second format pictures.](https://docs.microsoft.com/en-us/windows/win32/intl/hour--minute--and-second-format-pictures) See {ref}`time-format-example`
28
+
| \\D | If the Date/Time type of a [**Number Range Expression**](number_range_syntax) is used to match a string, this expression specifies a date format. It can be combined with **\\T**. [See available day, month, and year format pictures.](https://docs.microsoft.com/en-us/windows/win32/intl/day--month--year--and-era-format-pictures) See [Date format example](replacement_expression_syntax#date-format-example)
29
+
| \\T | If the Date/Time type of a [**Number Range Expression**](number_range_syntax) is used to match a string, this expression specifies a time format. It can be combined with **\\D**. [See available hour, minute, and second format pictures.](https://docs.microsoft.com/en-us/windows/win32/intl/hour--minute--and-second-format-pictures) See [Time format example](replacement_expression_syntax#time-format-example)
30
30
| (?Ntrue\_expression:false\_expression) | If sub-expression N was matched, then true\_expression is evaluated and sent to output, otherwise false\_expression is evaluated and sent to output. For example, (?1foo:bar) will replace each match found with foo if the sub-expression \\1 was matched, and with bar otherwise. Alternatively, you can write the expression in this form: (?{1}foo:bar) |
31
31
| $(Path) | File path. |
32
32
| $(Dir) | File directory. |
@@ -36,7 +36,6 @@ the **Replace** dialog box and in the **Replace in Files** dialog box.
36
36
| $(Lines) | Number of lines (cannot be used in **Replace in Files**). |
37
37
| $(CsvColumns) | Number of CSV columns (cannot be used in **Replace in Files**). |
38
38
39
-
(cell-function-beta)=
40
39
## cell function (beta)
41
40
42
41
The **cell** function can be used in JavaScript if **\\J** is also specified. This function retrieves the text in the specified CSV cell.
@@ -72,12 +71,10 @@ Specifies a combination of the following values. 0, 1, and 2 cannot be used toge
72
71
| 2 | The returned text may include surrounded double-quotes and delimiters. |
73
72
| 8 |_iColumn_ and _yLine_ parameters are expressed in 1-based absolute values. |
74
73
75
-
(date-format-example)=
76
74
## Date format example
77
75
78
76
If the matched date/time is "2022-03-31 21:30": <table><tbody><tr><th>Replacement Expression</th><th>Result</th></tr><tr><td>\DM/d/yyyy</td><td>3/31/2022</td></tr><tr><!-- cspell:disable-next-line --><td>\DMMMM, d, yyyy</td><td>March 31, 2022</td></tr><tr><td>\D'month='M 'day='d \THH:mm</td><td>month=3 day=31 21:30</td></tr></tbody></table>
79
77
80
-
(time-format-example)=
81
78
## Time format example
82
79
83
80
If the matched date/time is "2022-03-31 21:30": <table><tbody><tr><th>Replacement Expression</th><th>Result</th></tr><tr><td>\THH:mm</td><td>21:30</td></tr><tr><td>\Th:mm tt</td><td>9:30 PM</td></tr><tr><td>\THH:mm\D-yyyy-MM-dd</td><td>21:30-2022-03-31</td></tr></tbody></table>
0 commit comments