xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/rebrackloc.awk (revision 3ee4fc2aa6b5136515cc3eed32d3c6ef33e37471)
1*3ee4fc2aSCody Peter Mello# The third argument to match() is a GNU-specific extension, so the
2*3ee4fc2aSCody Peter Mello# two following tests have been replaced with similar ones that use
3*3ee4fc2aSCody Peter Mello# RSTART and RLENGTH:
4*3ee4fc2aSCody Peter Mello#
5*3ee4fc2aSCody Peter Mello# match($0, /([Nn]ew) Value +[\([]? *([[:upper:]]+)/, f) {
6*3ee4fc2aSCody Peter Mello# 	print "re1", NR, f[1], f[2]
7*3ee4fc2aSCody Peter Mello# }
8*3ee4fc2aSCody Peter Mello#
9*3ee4fc2aSCody Peter Mello# match($0, /([][])/, f) {
10*3ee4fc2aSCody Peter Mello# 	print "re2", NR, f[1]
11*3ee4fc2aSCody Peter Mello# }
12*3ee4fc2aSCody Peter Mello
13*3ee4fc2aSCody Peter Mellomatch($0, /([Nn]ew)/) {
14*3ee4fc2aSCody Peter Mello	print "re1.1", NR, substr($0, RSTART, RLENGTH)
15*3ee4fc2aSCody Peter Mello}
16*3ee4fc2aSCody Peter Mello
17*3ee4fc2aSCody Peter Mellomatch($0, /[\([] *([[:upper:]]+)/) {
18*3ee4fc2aSCody Peter Mello	print "re1.2", NR, substr($0, RSTART+1, RLENGTH-1)
19*3ee4fc2aSCody Peter Mello}
20*3ee4fc2aSCody Peter Mello
21*3ee4fc2aSCody Peter Mellomatch($0, /([][])/) {
22*3ee4fc2aSCody Peter Mello	print "re2", NR, substr($0, RSTART, RLENGTH)
23*3ee4fc2aSCody Peter Mello}
24*3ee4fc2aSCody Peter Mello
25*3ee4fc2aSCody Peter Mello/[]]/ {
26*3ee4fc2aSCody Peter Mello	print "re3", NR, $0
27*3ee4fc2aSCody Peter Mello}
28*3ee4fc2aSCody Peter Mello
29*3ee4fc2aSCody Peter Mello/[\[]/ {
30*3ee4fc2aSCody Peter Mello	print "re4", NR, $0
31*3ee4fc2aSCody Peter Mello}
32*3ee4fc2aSCody Peter Mello
33*3ee4fc2aSCody Peter Mello/[[]/ {
34*3ee4fc2aSCody Peter Mello	print "re5", NR, $0
35*3ee4fc2aSCody Peter Mello}
36*3ee4fc2aSCody Peter Mello
37*3ee4fc2aSCody Peter Mello/[][]/ {
38*3ee4fc2aSCody Peter Mello	print "re6", NR, $0
39*3ee4fc2aSCody Peter Mello}
40*3ee4fc2aSCody Peter Mello
41*3ee4fc2aSCody Peter Mello/[\([][[:upper:]]*/ {
42*3ee4fc2aSCody Peter Mello	print "re7", NR, $0
43*3ee4fc2aSCody Peter Mello}
44*3ee4fc2aSCody Peter Mello
45*3ee4fc2aSCody Peter Mello/[\([]/ {
46*3ee4fc2aSCody Peter Mello	print "re8", NR, $0
47*3ee4fc2aSCody Peter Mello}
48