2017-05-06 12:19:39 -04:00
|
|
|
# This file tests the auxiliary pattern conversion features of the PCRE2
|
|
|
|
# library, in non-UTF mode.
|
|
|
|
|
|
|
|
#forbid_utf
|
|
|
|
#newline_default lf any anycrlf
|
|
|
|
|
|
|
|
# -------- Tests of glob conversion --------
|
|
|
|
|
|
|
|
# Set the glob separator explicitly so that different OS defaults are not a
|
|
|
|
# problem. Then test various errors.
|
|
|
|
|
2017-05-22 06:23:36 -04:00
|
|
|
#pattern convert=glob,convert_glob_separator=/
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
/abc/posix
|
|
|
|
** The convert and posix modifiers are mutually exclusive
|
|
|
|
|
|
|
|
# Separator must be / \ or .
|
|
|
|
|
|
|
|
/a*b/convert_glob_separator=%
|
|
|
|
** Invalid glob separator '%'
|
|
|
|
|
|
|
|
# Can't have separator in a class
|
|
|
|
|
|
|
|
"[ab/cd]"
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\A[ab/cd](?<!/)\z
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
"[,-/]"
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\A[,-/](?<!/)\z
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
/[ab/
|
|
|
|
** Pattern conversion error at offset 3: missing terminating ] for character class
|
|
|
|
|
|
|
|
# Length check
|
|
|
|
|
2017-05-19 12:41:10 -04:00
|
|
|
/abc/convert_length=11
|
2017-05-06 12:19:39 -04:00
|
|
|
** Pattern conversion error at offset 3: no more memory
|
|
|
|
|
2017-05-19 12:41:10 -04:00
|
|
|
/abc/convert_length=12
|
|
|
|
(?s)\Aabc\z
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
# Now some actual tests
|
|
|
|
|
|
|
|
/a?b[]xy]*c/
|
2017-05-24 11:22:03 -04:00
|
|
|
(?s)\Aa[^/]b[\]xy](*COMMIT)[^/]*?c\z
|
2017-05-06 12:19:39 -04:00
|
|
|
azb]1234c
|
|
|
|
0: azb]1234c
|
|
|
|
|
|
|
|
# Tests from the gitwildmatch list, with some additions
|
|
|
|
|
|
|
|
/foo/
|
2017-05-18 23:55:39 -04:00
|
|
|
(?s)\Afoo\z
|
2017-05-06 12:19:39 -04:00
|
|
|
foo
|
|
|
|
0: foo
|
|
|
|
/= Expect no match
|
|
|
|
No match
|
|
|
|
bar
|
|
|
|
No match
|
|
|
|
|
|
|
|
//
|
2017-05-18 23:55:39 -04:00
|
|
|
(?s)\A\z
|
2017-05-06 12:19:39 -04:00
|
|
|
\
|
|
|
|
0:
|
|
|
|
|
|
|
|
/???/
|
2017-05-19 12:41:10 -04:00
|
|
|
(?s)\A[^/][^/][^/]\z
|
2017-05-06 12:19:39 -04:00
|
|
|
foo
|
|
|
|
0: foo
|
|
|
|
\= Expect no match
|
|
|
|
foobar
|
|
|
|
No match
|
|
|
|
|
|
|
|
/*/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\A[^/]*+\z
|
2017-05-06 12:19:39 -04:00
|
|
|
foo
|
|
|
|
0: foo
|
|
|
|
\
|
|
|
|
0:
|
|
|
|
|
|
|
|
/f*/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\Af(*COMMIT)[^/]*+\z
|
2017-05-06 12:19:39 -04:00
|
|
|
foo
|
|
|
|
0: foo
|
|
|
|
f
|
|
|
|
0: f
|
|
|
|
|
|
|
|
/*f/
|
2017-05-19 12:41:10 -04:00
|
|
|
(?s)\A[^/]*?f\z
|
2017-05-06 12:19:39 -04:00
|
|
|
oof
|
|
|
|
0: oof
|
|
|
|
\= Expect no match
|
|
|
|
foo
|
|
|
|
No match
|
|
|
|
|
|
|
|
/*foo*/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\A[^/]*?foo(*COMMIT)[^/]*+\z
|
2017-05-06 12:19:39 -04:00
|
|
|
foo
|
|
|
|
0: foo
|
|
|
|
food
|
|
|
|
0: food
|
|
|
|
aprilfool
|
|
|
|
0: aprilfool
|
|
|
|
|
|
|
|
/*ob*a*r*/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\A[^/]*?ob(*COMMIT)[^/]*?a(*COMMIT)[^/]*?r(*COMMIT)[^/]*+\z
|
2017-05-06 12:19:39 -04:00
|
|
|
foobar
|
|
|
|
0: foobar
|
|
|
|
|
|
|
|
/*ab/
|
2017-05-19 12:41:10 -04:00
|
|
|
(?s)\A[^/]*?ab\z
|
2017-05-06 12:19:39 -04:00
|
|
|
aaaaaaabababab
|
|
|
|
0: aaaaaaabababab
|
|
|
|
|
|
|
|
/foo\*/
|
2017-05-18 23:55:39 -04:00
|
|
|
(?s)\Afoo\*\z
|
2017-05-06 12:19:39 -04:00
|
|
|
foo*
|
|
|
|
0: foo*
|
|
|
|
|
|
|
|
/foo\*bar/
|
2017-05-18 23:55:39 -04:00
|
|
|
(?s)\Afoo\*bar\z
|
2017-05-06 12:19:39 -04:00
|
|
|
\= Expect no match
|
|
|
|
foobar
|
|
|
|
No match
|
|
|
|
|
|
|
|
/f\\oo/
|
2017-05-18 23:55:39 -04:00
|
|
|
(?s)\Af\\oo\z
|
2017-05-06 12:19:39 -04:00
|
|
|
f\\oo
|
|
|
|
0: f\oo
|
|
|
|
|
|
|
|
/*[al]?/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\A[^/]*?[al][^/]\z
|
2017-05-06 12:19:39 -04:00
|
|
|
ball
|
|
|
|
0: ball
|
|
|
|
|
|
|
|
/[ten]/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\A[ten]\z
|
2017-05-06 12:19:39 -04:00
|
|
|
\= Expect no match
|
|
|
|
ten
|
|
|
|
No match
|
|
|
|
|
|
|
|
/t[a-g]n/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\At[a-g]n\z
|
2017-05-06 12:19:39 -04:00
|
|
|
ten
|
|
|
|
0: ten
|
|
|
|
|
|
|
|
/a[]]b/
|
2017-05-24 11:22:03 -04:00
|
|
|
(?s)\Aa[\]]b\z
|
2017-05-06 12:19:39 -04:00
|
|
|
a]b
|
|
|
|
0: a]b
|
|
|
|
|
2017-05-19 12:41:10 -04:00
|
|
|
/a[]a-]b/
|
2017-05-24 11:22:03 -04:00
|
|
|
(?s)\Aa[\]a\-]b\z
|
2017-05-19 12:41:10 -04:00
|
|
|
|
2017-05-06 12:19:39 -04:00
|
|
|
/a[]-]b/
|
2017-05-24 11:22:03 -04:00
|
|
|
(?s)\Aa[\]\-]b\z
|
2017-05-06 12:19:39 -04:00
|
|
|
a-b
|
2017-05-24 06:14:43 -04:00
|
|
|
0: a-b
|
2017-05-06 12:19:39 -04:00
|
|
|
a]b
|
2017-05-24 06:14:43 -04:00
|
|
|
0: a]b
|
2017-05-06 12:19:39 -04:00
|
|
|
\= Expect no match
|
|
|
|
aab
|
2017-05-24 06:14:43 -04:00
|
|
|
No match
|
2017-05-06 12:19:39 -04:00
|
|
|
|
2017-05-19 12:41:10 -04:00
|
|
|
/a[]a-z]b/
|
2017-05-24 11:22:03 -04:00
|
|
|
(?s)\Aa[\]a-z]b\z
|
2017-05-06 12:19:39 -04:00
|
|
|
aab
|
|
|
|
0: aab
|
|
|
|
|
|
|
|
/]/
|
2017-05-19 12:41:10 -04:00
|
|
|
(?s)\A\]\z
|
2017-05-06 12:19:39 -04:00
|
|
|
]
|
|
|
|
0: ]
|
|
|
|
|
|
|
|
/t[!a-g]n/
|
2017-05-19 12:41:10 -04:00
|
|
|
(?s)\At[^/a-g]n\z
|
2017-05-06 12:19:39 -04:00
|
|
|
ton
|
|
|
|
0: ton
|
|
|
|
\= Expect no match
|
|
|
|
ten
|
|
|
|
No match
|
|
|
|
|
|
|
|
'[[:alpha:]][[:digit:]][[:upper:]]'
|
2017-05-25 09:19:42 -04:00
|
|
|
(?s)\A[[:alpha:]][[:digit:]][[:upper:]]\z
|
2017-05-06 12:19:39 -04:00
|
|
|
a1B
|
|
|
|
0: a1B
|
|
|
|
|
|
|
|
'[[:digit:][:upper:][:space:]]'
|
2017-05-25 09:19:42 -04:00
|
|
|
(?s)\A[[:digit:][:upper:][:space:]]\z
|
2017-05-06 12:19:39 -04:00
|
|
|
A
|
|
|
|
0: A
|
|
|
|
1
|
|
|
|
0: 1
|
|
|
|
\ \=
|
|
|
|
0:
|
|
|
|
\= Expect no match
|
|
|
|
a
|
|
|
|
No match
|
|
|
|
.
|
|
|
|
No match
|
|
|
|
|
|
|
|
'[a-c[:digit:]x-z]'
|
2017-05-25 09:19:42 -04:00
|
|
|
(?s)\A[a-c[:digit:]x-z]\z
|
2017-05-06 12:19:39 -04:00
|
|
|
5
|
|
|
|
0: 5
|
|
|
|
b
|
|
|
|
0: b
|
|
|
|
y
|
|
|
|
0: y
|
|
|
|
\= Expect no match
|
|
|
|
q
|
|
|
|
No match
|
|
|
|
|
|
|
|
# End of gitwildmatch tests
|
|
|
|
|
|
|
|
/*.j?g/
|
2017-05-19 12:41:10 -04:00
|
|
|
(?s)\A[^/]*?\.j[^/]g\z
|
2017-05-06 12:19:39 -04:00
|
|
|
pic01.jpg
|
|
|
|
0: pic01.jpg
|
|
|
|
.jpg
|
2017-05-19 12:41:10 -04:00
|
|
|
0: .jpg
|
2017-05-06 12:19:39 -04:00
|
|
|
pic02.jxg
|
|
|
|
0: pic02.jxg
|
|
|
|
\= Expect no match
|
|
|
|
pic03.j/g
|
|
|
|
No match
|
|
|
|
|
|
|
|
/A[+-0]B/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\AA[+-0](?<!/)B\z
|
2017-05-06 12:19:39 -04:00
|
|
|
A+B
|
|
|
|
0: A+B
|
|
|
|
A.B
|
|
|
|
0: A.B
|
|
|
|
A0B
|
|
|
|
0: A0B
|
|
|
|
\= Expect no match
|
|
|
|
A/B
|
|
|
|
No match
|
|
|
|
|
|
|
|
/*x?z/
|
2017-05-19 12:41:10 -04:00
|
|
|
(?s)\A[^/]*?x[^/]z\z
|
2017-05-06 12:19:39 -04:00
|
|
|
abc.xyz
|
|
|
|
0: abc.xyz
|
|
|
|
\= Expect no match
|
|
|
|
.xyz
|
2017-05-19 12:41:10 -04:00
|
|
|
0: .xyz
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
/?x?z/
|
2017-05-19 12:41:10 -04:00
|
|
|
(?s)\A[^/]x[^/]z\z
|
2017-05-06 12:19:39 -04:00
|
|
|
axyz
|
|
|
|
0: axyz
|
|
|
|
\= Expect no match
|
|
|
|
.xyz
|
2017-05-19 12:41:10 -04:00
|
|
|
0: .xyz
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
"[,-0]x?z"
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\A[,-0](?<!/)x[^/]z\z
|
2017-05-06 12:19:39 -04:00
|
|
|
,xyz
|
|
|
|
0: ,xyz
|
|
|
|
\= Expect no match
|
|
|
|
/xyz
|
|
|
|
No match
|
|
|
|
.xyz
|
2017-05-19 12:41:10 -04:00
|
|
|
0: .xyz
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
".x*"
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\A\.x(*COMMIT)[^/]*+\z
|
2017-05-06 12:19:39 -04:00
|
|
|
.xabc
|
|
|
|
0: .xabc
|
|
|
|
|
|
|
|
/a[--0]z/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\Aa[\--0](?<!/)z\z
|
2017-05-06 12:19:39 -04:00
|
|
|
a-z
|
|
|
|
0: a-z
|
|
|
|
a.z
|
|
|
|
0: a.z
|
|
|
|
a0z
|
|
|
|
0: a0z
|
|
|
|
\= Expect no match
|
|
|
|
a/z
|
|
|
|
No match
|
|
|
|
a1z
|
|
|
|
No match
|
|
|
|
|
|
|
|
/<[a-c-d]>/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\A<[a-c\-d]>\z
|
2017-05-06 12:19:39 -04:00
|
|
|
<a>
|
|
|
|
0: <a>
|
|
|
|
<b>
|
|
|
|
0: <b>
|
|
|
|
<c>
|
|
|
|
0: <c>
|
|
|
|
<d>
|
|
|
|
0: <d>
|
|
|
|
<->
|
|
|
|
0: <->
|
|
|
|
|
|
|
|
/a[[:digit:].]z/
|
2017-05-25 09:19:42 -04:00
|
|
|
(?s)\Aa[[:digit:].]z\z
|
2017-05-06 12:19:39 -04:00
|
|
|
a1z
|
|
|
|
0: a1z
|
|
|
|
a.z
|
|
|
|
0: a.z
|
|
|
|
\= Expect no match
|
|
|
|
a:z
|
|
|
|
No match
|
|
|
|
|
|
|
|
/a[[:digit].]z/
|
2017-05-25 09:19:42 -04:00
|
|
|
(?s)\Aa[\[:digit]\.\]z\z
|
2017-05-06 12:19:39 -04:00
|
|
|
a[.]z
|
2017-05-25 09:19:42 -04:00
|
|
|
0: a[.]z
|
2017-05-06 12:19:39 -04:00
|
|
|
a:.]z
|
2017-05-25 09:19:42 -04:00
|
|
|
0: a:.]z
|
2017-05-06 12:19:39 -04:00
|
|
|
ad.]z
|
2017-05-25 09:19:42 -04:00
|
|
|
0: ad.]z
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
/<[[:a[:digit:]b]>/
|
2017-05-25 09:19:42 -04:00
|
|
|
(?s)\A<[\[:a[:digit:]b]>\z
|
2017-05-06 12:19:39 -04:00
|
|
|
<[>
|
2017-05-25 09:19:42 -04:00
|
|
|
0: <[>
|
2017-05-06 12:19:39 -04:00
|
|
|
<:>
|
2017-05-25 09:19:42 -04:00
|
|
|
0: <:>
|
2017-05-06 12:19:39 -04:00
|
|
|
<a>
|
2017-05-25 09:19:42 -04:00
|
|
|
0: <a>
|
2017-05-06 12:19:39 -04:00
|
|
|
<9>
|
2017-05-25 09:19:42 -04:00
|
|
|
0: <9>
|
2017-05-06 12:19:39 -04:00
|
|
|
<b>
|
2017-05-25 09:19:42 -04:00
|
|
|
0: <b>
|
2017-05-06 12:19:39 -04:00
|
|
|
\= Expect no match
|
|
|
|
<d>
|
2017-05-25 09:19:42 -04:00
|
|
|
No match
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
/a*b/convert_glob_separator=\
|
2017-05-19 12:41:10 -04:00
|
|
|
(?s)\Aa(*COMMIT)[^\\]*?b\z
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
/a*b/convert_glob_separator=.
|
2017-05-19 12:41:10 -04:00
|
|
|
(?s)\Aa(*COMMIT)[^\.]*?b\z
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
/a*b/convert_glob_separator=/
|
2017-05-19 12:41:10 -04:00
|
|
|
(?s)\Aa(*COMMIT)[^/]*?b\z
|
2017-05-06 12:19:39 -04:00
|
|
|
|
2017-05-16 03:14:11 -04:00
|
|
|
# Non control character checking
|
|
|
|
|
|
|
|
/A\B\\C\D/
|
2017-05-17 09:44:24 -04:00
|
|
|
(?s)\AAB\\CD\z
|
2017-05-16 03:14:11 -04:00
|
|
|
|
2017-05-17 09:44:24 -04:00
|
|
|
/\\{}\?\*+\[\]()|.^$/
|
|
|
|
(?s)\A\\\{\}\?\*\+\[\]\(\)\|\.\^\$\z
|
2017-05-16 03:14:11 -04:00
|
|
|
|
|
|
|
/*a*\/*b*/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\A[^/]*?a(*COMMIT)[^/]*?/(*COMMIT)[^/]*?b(*COMMIT)[^/]*+\z
|
2017-05-16 03:14:11 -04:00
|
|
|
|
|
|
|
/?a?\/?b?/
|
2017-05-17 09:44:24 -04:00
|
|
|
(?s)\A[^/]a[^/]/[^/]b[^/]\z
|
2017-05-16 03:14:11 -04:00
|
|
|
|
2017-05-18 02:46:22 -04:00
|
|
|
/[a\\b\c][]][-][\]\-]/
|
2017-05-24 11:22:03 -04:00
|
|
|
(?s)\A[a\\bc][\]][\-][\]\-]\z
|
2017-05-18 02:46:22 -04:00
|
|
|
|
|
|
|
/[^a\\b\c][!]][!-][^\]\-]/
|
2017-05-24 11:22:03 -04:00
|
|
|
(?s)\A[^/a\\bc][^/\]][^/\-][^/\]\-]\z
|
2017-05-18 02:46:22 -04:00
|
|
|
|
2017-05-28 00:05:58 -04:00
|
|
|
/[[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:word:][:xdigit:]]/
|
|
|
|
(?s)\A[[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:word:][:xdigit:]](?<!/)\z
|
2017-05-24 06:14:43 -04:00
|
|
|
|
|
|
|
"[/-/]"
|
|
|
|
(?s)\A[/-/](?<!/)\z
|
|
|
|
|
|
|
|
/[-----]/
|
|
|
|
(?s)\A[\--\-\-\-]\z
|
|
|
|
|
|
|
|
/[------]/
|
|
|
|
(?s)\A[\--\-\--\-]\z
|
|
|
|
|
|
|
|
/[!------]/
|
|
|
|
(?s)\A[^/\--\-\--\-]\z
|
|
|
|
|
|
|
|
/[[:alpha:]-a]/
|
2017-05-25 09:19:42 -04:00
|
|
|
(?s)\A[[:alpha:]\-a]\z
|
|
|
|
|
|
|
|
/[[:alpha:]][[:punct:]][[:ascii:]]/
|
|
|
|
(?s)\A[[:alpha:]][[:punct:]](?<!/)[[:ascii:]](?<!/)\z
|
2017-05-24 06:14:43 -04:00
|
|
|
|
|
|
|
/[a-[:alpha:]]/
|
|
|
|
** Pattern conversion error at offset 4: invalid syntax
|
2017-05-18 02:46:22 -04:00
|
|
|
|
|
|
|
/[[:alpha:/
|
|
|
|
** Pattern conversion error at offset 9: missing terminating ] for character class
|
|
|
|
|
|
|
|
/[[:alpha:]/
|
|
|
|
** Pattern conversion error at offset 10: missing terminating ] for character class
|
|
|
|
|
|
|
|
/[[:alphaa:]]/
|
2017-05-25 09:19:42 -04:00
|
|
|
(?s)\A[\[:alphaa:]\]\z
|
2017-05-18 02:46:22 -04:00
|
|
|
|
|
|
|
/[[:xdigi:]]/
|
2017-05-25 09:19:42 -04:00
|
|
|
(?s)\A[\[:xdigi:]\]\z
|
2017-05-18 02:46:22 -04:00
|
|
|
|
|
|
|
/[[:xdigit::]]/
|
2017-05-25 09:19:42 -04:00
|
|
|
(?s)\A[\[:xdigit::]\]\z
|
2017-05-18 02:46:22 -04:00
|
|
|
|
2017-05-18 23:55:39 -04:00
|
|
|
/****/
|
|
|
|
(?s)
|
|
|
|
|
|
|
|
/**\/abc/
|
2017-05-23 11:17:44 -04:00
|
|
|
(?s)(?:\A|/)abc\z
|
2017-05-24 11:22:03 -04:00
|
|
|
abc
|
|
|
|
0: abc
|
|
|
|
x/abc
|
|
|
|
0: /abc
|
|
|
|
xabc
|
|
|
|
No match
|
2017-05-18 23:55:39 -04:00
|
|
|
|
|
|
|
/abc\/**/
|
|
|
|
(?s)\Aabc/
|
|
|
|
|
|
|
|
/abc\/**\/abc/
|
|
|
|
(?s)\Aabc/(*COMMIT)(?:.*?/)??abc\z
|
2017-05-16 03:14:11 -04:00
|
|
|
|
2017-05-23 11:17:44 -04:00
|
|
|
/**\/*a*b*g*n*t/
|
|
|
|
(?s)(?:\A|/)(?>[^/]*?a)(?>[^/]*?b)(?>[^/]*?g)(?>[^/]*?n)(?>[^/]*?t\z)
|
|
|
|
abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txt
|
|
|
|
0: /abcdefghijklmnop.txt
|
|
|
|
|
|
|
|
/**\/*a*\/**/
|
|
|
|
(?s)(?:\A|/)(?>[^/]*?a)(?>[^/]*?/)
|
|
|
|
xx/xx/xx/xax/xx/xb
|
|
|
|
0: /xax/
|
|
|
|
|
|
|
|
/**\/*a*/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)(?:\A|/)(?>[^/]*?a)(?>[^/]*+\z)
|
2017-05-23 11:17:44 -04:00
|
|
|
xx/xx/xx/xax
|
|
|
|
0: /xax
|
|
|
|
xx/xx/xx/xax/xx
|
|
|
|
No match
|
|
|
|
|
|
|
|
/**\/*a*\/**\/*b*/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)(?:\A|/)(?>[^/]*?a)(?>[^/]*?/)(*COMMIT)(?:.*?/)??(?>[^/]*?b)(?>[^/]*+\z)
|
2017-05-23 11:17:44 -04:00
|
|
|
xx/xx/xx/xax/xx/xb
|
|
|
|
0: /xax/xx/xb
|
|
|
|
xx/xx/xx/xax/xx/x
|
|
|
|
No match
|
|
|
|
|
2017-05-24 11:22:03 -04:00
|
|
|
"**a"convert=glob
|
|
|
|
(?s)a\z
|
|
|
|
a
|
|
|
|
0: a
|
|
|
|
c/b/a
|
|
|
|
0: a
|
|
|
|
c/b/aaa
|
|
|
|
0: a
|
|
|
|
|
|
|
|
"a**/b"convert=glob
|
|
|
|
(?s)\Aa(*COMMIT).*?/b\z
|
|
|
|
a/b
|
|
|
|
0: a/b
|
|
|
|
ab
|
|
|
|
No match
|
|
|
|
|
|
|
|
"a/**b"convert=glob
|
|
|
|
(?s)\Aa/(*COMMIT).*?b\z
|
|
|
|
a/b
|
|
|
|
0: a/b
|
|
|
|
ab
|
|
|
|
No match
|
|
|
|
|
2017-05-22 06:23:36 -04:00
|
|
|
#pattern convert=glob:glob_no_starstar
|
|
|
|
|
|
|
|
/***/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\A[^/]*+\z
|
2017-05-22 06:23:36 -04:00
|
|
|
|
|
|
|
/**a**/
|
2017-05-24 06:14:43 -04:00
|
|
|
(?s)\A[^/]*?a(*COMMIT)[^/]*+\z
|
2017-05-22 06:23:36 -04:00
|
|
|
|
|
|
|
#pattern convert=unset
|
|
|
|
#pattern convert=glob:glob_no_wild_separator
|
|
|
|
|
|
|
|
/*/
|
|
|
|
(?s)
|
|
|
|
|
|
|
|
/*a*/
|
|
|
|
(?s)a
|
|
|
|
|
|
|
|
/**a**/
|
2017-05-24 11:22:03 -04:00
|
|
|
(?s)a
|
2017-05-22 06:23:36 -04:00
|
|
|
|
|
|
|
/a*b/
|
|
|
|
(?s)\Aa(*COMMIT).*?b\z
|
|
|
|
|
|
|
|
/*a*b*/
|
|
|
|
(?s)a(*COMMIT).*?b
|
|
|
|
|
|
|
|
/??a??/
|
|
|
|
(?s)\A..a..\z
|
|
|
|
|
|
|
|
#pattern convert=unset
|
2017-05-23 12:08:48 -04:00
|
|
|
#pattern convert=glob,convert_glob_escape=0
|
2017-05-22 06:23:36 -04:00
|
|
|
|
|
|
|
/a\b\cd/
|
|
|
|
(?s)\Aa\\b\\cd\z
|
|
|
|
|
|
|
|
/**\/a/
|
2017-05-24 11:22:03 -04:00
|
|
|
(?s)\\/a\z
|
2017-05-22 06:23:36 -04:00
|
|
|
|
2017-05-23 12:08:48 -04:00
|
|
|
/a`*b/convert_glob_escape=`
|
|
|
|
(?s)\Aa\*b\z
|
|
|
|
|
|
|
|
/a`*b/convert_glob_escape=0
|
|
|
|
(?s)\Aa`(*COMMIT)[^/]*?b\z
|
|
|
|
|
|
|
|
/a`*b/convert_glob_escape=x
|
|
|
|
** Invalid glob escape 'x'
|
|
|
|
|
2017-05-27 13:08:28 -04:00
|
|
|
# -------- Tests of extended POSIX conversion --------
|
2017-05-06 12:19:39 -04:00
|
|
|
|
2017-05-27 13:08:28 -04:00
|
|
|
#pattern convert=unset:posix_extended
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
/<[[:a[:digit:]b]>/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)<[[:a[:digit:]b]>
|
2017-05-06 12:19:39 -04:00
|
|
|
<[>
|
|
|
|
0: <[>
|
|
|
|
<:>
|
|
|
|
0: <:>
|
|
|
|
<a>
|
|
|
|
0: <a>
|
|
|
|
<9>
|
|
|
|
0: <9>
|
|
|
|
<b>
|
|
|
|
0: <b>
|
|
|
|
\= Expect no match
|
|
|
|
<d>
|
|
|
|
No match
|
|
|
|
|
|
|
|
/a+\1b\\c|d[ab\c]/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)a+1b\\c|d[ab\\c]
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
/<[]bc]>/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)<[]bc]>
|
2017-05-06 12:19:39 -04:00
|
|
|
<]>
|
|
|
|
0: <]>
|
|
|
|
<b>
|
|
|
|
0: <b>
|
|
|
|
<c>
|
|
|
|
0: <c>
|
|
|
|
|
|
|
|
/<[^]bc]>/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)<[^]bc]>
|
2017-05-06 12:19:39 -04:00
|
|
|
<.>
|
|
|
|
0: <.>
|
|
|
|
\= Expect no match
|
|
|
|
<]>
|
|
|
|
No match
|
|
|
|
<b>
|
|
|
|
No match
|
|
|
|
|
|
|
|
/(a)\1b/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)(a)1b
|
2017-05-06 12:19:39 -04:00
|
|
|
a1b
|
|
|
|
0: a1b
|
|
|
|
1: a
|
|
|
|
\= Expect no match
|
|
|
|
aab
|
|
|
|
No match
|
|
|
|
|
2017-05-13 13:46:27 -04:00
|
|
|
/(ab)c)d]/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)(ab)c\)d\]
|
2017-05-13 13:46:27 -04:00
|
|
|
Xabc)d]Y
|
|
|
|
0: abc)d]
|
|
|
|
1: ab
|
|
|
|
|
|
|
|
/a***b/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)a*b
|
|
|
|
|
|
|
|
# -------- Tests of basic POSIX conversion --------
|
2017-05-13 13:46:27 -04:00
|
|
|
|
2017-05-20 07:40:12 -04:00
|
|
|
#pattern convert=unset:posix_basic
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
/a*b+c\+[def](ab)\(cd\)/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)a*b\+c\+[def]\(ab\)(cd)
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
/\(a\)\1b/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)(a)\1b
|
2017-05-06 12:19:39 -04:00
|
|
|
aab
|
|
|
|
0: aab
|
|
|
|
1: a
|
|
|
|
\= Expect no match
|
|
|
|
a1b
|
|
|
|
No match
|
|
|
|
|
2017-05-10 11:42:13 -04:00
|
|
|
/how.to how\.to/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)how.to how\.to
|
|
|
|
how\nto how.to
|
|
|
|
0: how\x0ato how.to
|
|
|
|
\= Expect no match
|
|
|
|
how\x{0}to how.to
|
|
|
|
No match
|
2017-05-09 06:44:50 -04:00
|
|
|
|
2017-05-10 11:42:13 -04:00
|
|
|
/^how to \^how to/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)^how to \^how to
|
2017-05-09 06:44:50 -04:00
|
|
|
|
2017-05-14 08:04:13 -04:00
|
|
|
/^*abc/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)^\*abc
|
2017-05-14 08:04:13 -04:00
|
|
|
|
2017-05-13 13:46:27 -04:00
|
|
|
/*abc/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)\*abc
|
2017-05-13 13:46:27 -04:00
|
|
|
X*abcY
|
|
|
|
0: *abc
|
|
|
|
|
|
|
|
/**abc/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)\**abc
|
2017-05-13 13:46:27 -04:00
|
|
|
XabcY
|
|
|
|
0: abc
|
|
|
|
X*abcY
|
|
|
|
0: *abc
|
2017-05-14 08:04:13 -04:00
|
|
|
X**abcY
|
2017-05-13 13:46:27 -04:00
|
|
|
0: **abc
|
2017-05-27 13:08:28 -04:00
|
|
|
|
|
|
|
/*ab\(*cd\)/
|
|
|
|
(*NUL)\*ab(\*cd)
|
2017-05-13 13:46:27 -04:00
|
|
|
|
|
|
|
/^b\(c^d\)\(^e^f\)/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)^b(c\^d)(^e\^f)
|
2017-05-13 13:46:27 -04:00
|
|
|
|
|
|
|
/a***b/
|
2017-05-27 13:08:28 -04:00
|
|
|
(*NUL)a*b
|
2017-05-06 12:19:39 -04:00
|
|
|
|
|
|
|
# End of testinput24
|