Brace expansion using ranges: Difference between revisions

Content added Content deleted
(→‎{{header|JavaScript}}: Updated to include new example. (Need to resolve ambiguity identified on discussion page by Nigel Galloway))
(→‎Task: Updated output to show additional example. (Required to resolve ambiguity identified on Discussion page by Nigel Galloway))
Line 60: Line 60:
(The grammar of range expansion, unlike that of nested list expansion, is not recursive, so even regular expressions should prove serviceable here).
(The grammar of range expansion, unlike that of nested list expansion, is not recursive, so even regular expressions should prove serviceable here).


The output of the JS implementation, which aims to match the brace expansion behaviour of the default '''zsh''' shell on macOS Catalina is:
The output of the JS implementation, which aims to match the brace expansion behaviour of the default '''zsh''' shell on current versions of macOS:


<pre>simpleNumberRising{1..3}.txt ->
<pre>simpleNumberRising{1..3}.txt ->
Line 81: Line 81:
minusSignFlipsSequence 025.txt
minusSignFlipsSequence 025.txt
minusSignFlipsSequence 030.txt
minusSignFlipsSequence 030.txt

reverseSteppedNumberRising{1..6..-2}.txt ->
reverseSteppedNumberRising5.txt
reverseSteppedNumberRising3.txt
reverseSteppedNumberRising1.txt


combined-{Q..P}{2..1}.txt ->
combined-{Q..P}{2..1}.txt ->