File: regexsub.ok

package info (click to toggle)
gawk 1%3A5.3.2-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 24,120 kB
  • sloc: ansic: 56,743; awk: 14,966; sh: 6,985; yacc: 6,820; makefile: 3,144; sed: 119; python: 31; csh: 6
file content (30 lines) | stat: -rw-r--r-- 938 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Initialize strong regex
Test gsub on strong regex
rgx1 = '[abc]'	typeof(rgx1) = 'regexp'
rgx2 = '[abc]'	typeof(rgx2) = 'regexp'
Test gsub() a strong regex
rgx1 = '[abc]'	typeof(rgx1) = 'regexp'
rgx2 = '[aec]'	typeof(rgx2) = 'regexp'
Test value not found in regex
rgx1 = '[abc]'	typeof(rgx1) = 'regexp'
Test gsub on numbers
v1 = '12345'	typeof(v1) = 'number'
v2 = '12345'	typeof(v2) = 'number'
v1 = '12345'	typeof(v1) = 'number'
v2 = '12x45'	typeof(v2) = 'string'
Test value not found in number
v1 = '12345'	typeof(v1) = 'number'
Test gensub on regex
a = @/abc/	typeof(a) = 'regexp'
c = "axc"	typeof(c) = 'string'
Test value not found in regex
b = @/abc/	typeof(b) = 'regexp'
c = "abc"	typeof(c) = 'string'
Test gensub on numbers
a = "12345"	typeof(a) = 'number'
b = "12345"	typeof(b) = 'number'
c = "12x45"	typeof(c) = 'string'
Test value not found in number
b = "12345"	typeof(b) = 'number'
c = "12345"	typeof(c) = 'string'
string 12345