Results for regex.test.sh

casebashzshoshdescription
0pass pass pass Match is unanchored at both ends
1pass pass pass Failed match
2pass pass pass Regex quoted with \ -- preferred in bash
3ok pass pass Regex quoted with single quotes
details
4ok pass pass Regex quoted with double quotes
details
5pass pass pass Fix single quotes by storing in variable
6pass pass pass Fix single quotes by storing in variable
7ok pass pass Double quoting pat variable -- again bash doesn't like it.
details
8pass ok pass Regex with == and not =~ is parse error, different lexer mode required
details
9pass pass pass Omitting ( )
10pass ok pass Malformed regex
details
11pass pass FAIL Regex with char class
details
12pass N-I FAIL Operators lose meaning in () in regex state (BASH_REGEX_CAHRS)
detailsdetails
13pass N-I pass Regex with |
details

33 passed, 5 ok, 2 known unimplemented, 0 known bugs, 2 failed, 0 skipped

Details on runs that didn't PASS

bash3 Regex quoted with single quotes

stdout:
stderr: 
bash4 Regex quoted with double quotes

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

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

stdout:
stderr: 
zsh10 Malformed regex

stdout:
stderr: 
zsh: parse error near `)'
osh11 Regex with char class

[osh stdout] Expected 'true\n', got ''

stdout:
stderr: 
Error compiling regex: Un-matched bracket list operators.
Line 1 of '<stdin>'
  [[ 'ba ba ' =~ ([a b]+) ]] && echo true
                 ^
Invalid regex: '([a'
---
Line 1 of '<stdin>'
  [[ 'ba ba ' =~ ([a b]+) ]] && echo true
                 ^
Unexpected extra word (CompoundWord
  parts: [
    (LiteralPart token:(token id:Lit_Chars val:"(" span_id:8))
    (LiteralPart token:(token id:Lit_Other val:"[" span_id:9))
    (LiteralPart token:(token id:Lit_Chars val:a span_id:10))
  ]
)
---
Line 1 of '<stdin>'
  [[ 'ba ba ' =~ ([a b]+) ]] && echo true
  ^~
Error parsing [[
---
Line 0 of '<unknown>'
  <no position info for token>
Error parsing AndOr in ParseCommandTerm
---
zsh12 Operators lose meaning in () in regex state (BASH_REGEX_CAHRS)

stdout:
stderr: 
zsh: parse error near `<'
osh12 Operators lose meaning in () in regex state (BASH_REGEX_CAHRS)

[osh stdout] Expected 'true\n', got ''

stdout:
stderr: 
Error compiling regex: Un-matched parenthesis group operators.
Line 1 of '<stdin>'
  [[ '< >' =~ (< >) ]] && echo true
              ^
Invalid regex: '('
---
Line 1 of '<stdin>'
  [[ '< >' =~ (< >) ]] && echo true
              ^
Unexpected extra word (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:"(" span_id:8))])
---
Line 1 of '<stdin>'
  [[ '< >' =~ (< >) ]] && echo true
  ^~
Error parsing [[
---
Line 0 of '<unknown>'
  <no position info for token>
Error parsing AndOr in ParseCommandTerm
---
zsh13 Regex with |

stdout:
stderr: 
zsh: parse error near `|'