Skip to content

Commit 2eceaa3

Browse files
authored
Edit parse notes (#1429)
1 parent 9281317 commit 2eceaa3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

blog/2024-05-28-nushell_0_94_0.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -276,17 +276,18 @@ open --raw file.txt | skip 1024 | parse -r "some regex"
276276
The old behavior was to collect all of the output the external command or byte stream and then run the regex across the whole string. To mimic this behavior, you can use the `collect` command or store the output in a variable:
277277
```nushell
278278
^cat file.txt | collect | parse -r "some regex"
279+
279280
let text = open file.txt
280281
$text | parse -r "some regex"
281282
```
282283

283-
Note that this change does not affect normal value streams like
284+
Note that this change does not affect normal value streams like:
284285
```nushell
285-
[(open foo.txt) (open bar.txt)] | parse -r "..."
286+
[(open foo.txt) (open bar.txt)] | parse -r "some regex"
286287
```
287-
In this case, the regex is run once per string value in the stream and does a multi-line match over the contents of each string.
288+
In this case, the regex is run separately over each string value in the stream. With the proper regex flags, the regex is able to match across multiple lines within the same string value.
288289

289-
Note that `parse` may see more breaking changes in the next release to simplify this behavior.
290+
Note that `parse` may see more breaking changes in the next release to simplify these behaviors.
290291

291292
#### `scope commands` [[toc](#table-of-content)]
292293

0 commit comments

Comments
 (0)