2021-11-30 22:54:44 +03:00
|
|
|
$ fq -i -d mp3 . /test.mp3
|
2021-12-04 19:20:12 +03:00
|
|
|
mp3> .frames[1].data | match("3\u0085"; "b")
|
|
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
|
|
|
0x0f0| 33 85 d3 64| 3..d|.: raw bits 0xfc-0x1b2.7 (183)
|
|
|
|
0x100|f1 a1 c1 08 1c 58 1f 5e 1f 18 1c 46 04 1e 89 e5|.....X.^...F....|
|
|
|
|
* |until 0x1b2.7 (183) | |
|
|
|
|
mp3> .frames[1].data | match([0x33, 0x85])
|
|
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
|
|
|
0x0f0| 33 85 d3 64| 3..d|.: raw bits 0xfc-0x1b2.7 (183)
|
|
|
|
0x100|f1 a1 c1 08 1c 58 1f 5e 1f 18 1c 46 04 1e 89 e5|.....X.^...F....|
|
|
|
|
* |until 0x1b2.7 (183) | |
|
|
|
|
mp3> ^D
|
|
|
|
$ fq -ni
|
|
|
|
null> "64ff65ff66" | hex | match("\u00ff"; "b")
|
2021-11-30 22:54:44 +03:00
|
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
|
|
|
0x0| ff 65 ff 66| | .e.f| |.: raw bits 0x1-0x4.7 (4)
|
|
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
|
|
|
0x0| ff 66| | .f| |.: raw bits 0x3-0x4.7 (2)
|
2021-12-04 19:20:12 +03:00
|
|
|
null> "aöaöa" | tobytes | match("ö")
|
2021-11-30 22:54:44 +03:00
|
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
|
|
|
0x0| c3 b6 61 c3 b6 61| | ..a..a| |.: raw bits 0x1-0x6.7 (6)
|
|
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
|
|
|
0x0| c3 b6 61| | ..a| |.: raw bits 0x4-0x6.7 (3)
|
2021-12-04 19:20:12 +03:00
|
|
|
null> "aöaöa" | tobytes | match("\u00c3"; "b")
|
2021-11-30 22:54:44 +03:00
|
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
|
|
|
0x0| c3 b6 61 c3 b6 61| | ..a..a| |.: raw bits 0x1-0x6.7 (6)
|
|
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
|
|
|
0x0| c3 b6 61| | ..a| |.: raw bits 0x4-0x6.7 (3)
|
2021-12-04 19:20:12 +03:00
|
|
|
null> "aöaöa" | tobytes | match([0xc3])
|
2021-11-30 22:54:44 +03:00
|
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
|
|
|
0x0| c3 b6 61 c3 b6 61| | ..a..a| |.: raw bits 0x1-0x6.7 (6)
|
|
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
|
|
|
0x0| c3 b6 61| | ..a| |.: raw bits 0x4-0x6.7 (3)
|
2021-12-04 19:20:12 +03:00
|
|
|
null> "abba" | match("B"; "gi")
|
|
|
|
{
|
|
|
|
"captures": [],
|
|
|
|
"length": 1,
|
|
|
|
"offset": 1,
|
|
|
|
"string": "b"
|
|
|
|
}
|
|
|
|
{
|
|
|
|
"captures": [],
|
|
|
|
"length": 1,
|
|
|
|
"offset": 2,
|
|
|
|
"string": "b"
|
|
|
|
}
|
|
|
|
null> [range(256)] | . as $b | tobytes | match($b)
|
2021-11-30 22:54:44 +03:00
|
|
|
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
|
2021-12-04 19:20:12 +03:00
|
|
|
0x000|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|................|.: raw bits 0x0-0xff.7 (256)
|
|
|
|
* |until 0xff.7 (end) (256) | |
|
|
|
|
null> ^D
|