Results for regex.test.sh

casebashzshoshosh_ALTdescription
0pass N-I pass pass BASH_REMATCH
details
1pass pass pass pass Match is unanchored at both ends
2pass pass pass pass Failed match
3pass pass pass pass Regex quoted with \ -- preferred in bash
4pass ok pass pass Regex quoted with single quotes
details
5pass ok pass pass Regex quoted with double quotes
details
6pass pass pass pass Fix single quotes by storing in variable
7pass pass pass pass Fix single quotes by storing in variable
8pass ok pass pass Double quoting pat variable -- again bash doesn't like it.
details
9pass pass pass pass Mixing quoted and unquoted parts
10pass ok pass pass Regex with == and not =~ is parse error, different lexer mode required
details
11pass pass pass pass Omitting ( )
12pass ok pass pass Malformed regex
details
13pass pass FAIL FAIL Regex with char class containing space
detailsdetails
14pass N-I FAIL FAIL Operators and space lose meaning inside ()
detailsdetailsdetails
15pass N-I pass pass Regex with |
details
16pass ok pass pass Regex to match literal brackets []
details
17pass BUG pass pass Regex to match literals . ^ $ etc.
details
18BUG BUG pass pass Unquoted { is a regex parse error
detailsdetails
19BUG pass pass pass Fatal error inside [[ =~ ]]
details
20pass N-I pass pass Quoted {
details
21pass BUG pass pass Escaped {
details
22pass BUG pass pass Escaped { stored in variable first
details
23pass pass pass pass regex with ?

76 passed, 6 ok, 4 known unimplemented, 6 known bugs, 2 failed, 0 skipped

Details on runs that didn't PASS

zsh0 BASH_REMATCH

stdout:
['']
stderr:
zsh4 Regex quoted with single quotes

stdout:
true
stderr:
zsh5 Regex quoted with double quotes

stdout:
true
stderr:
zsh8 Double quoting pat variable -- again bash doesn't like it.

stdout:
true
stderr:
zsh10 Regex with == and not =~ is parse error, different lexer mode required

stdout:
stderr: 
zsh12 Malformed regex

stdout:
stderr: 
zsh: parse error near `)'
osh13 Regex with char class containing space

[osh stdout] Expected 'true\n', got ''
[osh status] Expected 0, got 2

stdout:
stderr: 
  [[ 'ba ba ' =~ ([a b]+) ]] && echo true
                     ^
[ stdin ]:1: Expected ]]
osh_ALT13 Regex with char class containing space

[osh_ALT stdout] Expected 'true\n', got ''
[osh_ALT status] Expected 0, got 2

stdout:
stderr: 
  [[ 'ba ba ' =~ ([a b]+) ]] && echo true
                     ^
[ stdin ]:1: Expected ]]
zsh14 Operators and space lose meaning inside ()

stdout:
stderr: 
zsh: parse error near `<'
osh14 Operators and space lose meaning inside ()

[osh stdout] Expected 'true\n', got ''
[osh status] Expected 0, got 2

stdout:
stderr: 
  [[ '< >' =~ (< >) ]] && echo true
                 ^
[ stdin ]:1: Expected ]]
osh_ALT14 Operators and space lose meaning inside ()

[osh_ALT stdout] Expected 'true\n', got ''
[osh_ALT status] Expected 0, got 2

stdout:
stderr: 
  [[ '< >' =~ (< >) ]] && echo true
                 ^
[ stdin ]:1: Expected ]]
zsh15 Regex with |

stdout:
stderr: 
zsh: parse error near `|'
zsh16 Regex to match literal brackets []

stdout:
true
stderr:
zsh: failed to compile regex: Unmatched [ or [^
zsh17 Regex to match literals . ^ $ etc.

stdout:
true
false
false
false
stderr:
zsh: failed to compile regex: Invalid preceding regular expression
zsh: failed to compile regex: Invalid preceding regular expression
zsh: failed to compile regex: Invalid preceding regular expression
zsh: failed to compile regex: Invalid preceding regular expression
bash18 Unquoted { is a regex parse error

stdout:
status=2
stderr:
zsh18 Unquoted { is a regex parse error

stdout:
status=1
stderr:
zsh: failed to compile regex: Invalid preceding regular expression
bash19 Fatal error inside [[ =~ ]]

stdout:
status=1
stderr:
_tmp/spec-bin/bash: line 1: 1 / 0 : division by 0 (error token is "0 ")
zsh20 Quoted {

stdout:
status=1
stderr:
zsh: failed to compile regex: Invalid preceding regular expression
zsh21 Escaped {

stdout:
stderr: 
zsh: failed to compile regex: Invalid preceding regular expression
zsh22 Escaped { stored in variable first

stdout:
['']
stderr: