~nilium/go-fex

f94bdeba7c40d9398fff97a5be098a62fe8ff148 — Noel Cower 1 year, 4 days ago 7007611 main
Update README addresses

Update README addresses to point to the current sr.ht home for go-fex,
including the public inbox email address for sending patches to.
2 files changed, 55 insertions(+), 31 deletions(-)

M README.adoc
M fex.1
M README.adoc => README.adoc +6 -5
@@ 163,12 163,13 @@ Pull the IP address (first field by space) and the path requested (2nd field in
You can file bugs, feature requests, or questions about the Go implementation at
the following URL:

link:https://github.com/nilium/go-fex/issues[]
link:https://todo.sr.ht/~nilium/tools[]

Patches, discussion, ideas, issues, and so on are all welcome.
Patches, discussion, ideas, issues, and so on are all welcome. Patches may be
emailed to ~nilium/public-inbox@lists.sr.ht.

You can send any of the above by email to ncower@gmail.com if you're more
comfortable with that.
You can send any of the above by email to ncower@nil.dev if you're more
comfortable with that or would like your contact to remain private.

[[notes]]
== Discussion


@@ 188,7 189,7 @@ expressions are case-insensitive while the Go implementation's are not.

Related tools: *awk(1)*, *cut(1)*.

Project site: link:https://github.com/nilium/go-fex[]
Project site: link:https://git.sr.ht/~nilium/go-fex[]

Original C fex project site: link:https://www.semicomplete.com/projects/fex[]


M fex.1 => fex.1 +49 -26
@@ 1,13 1,13 @@
'\" t
.\"     Title: fex
.\"    Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 1.5.8
.\"      Date: 2018-12-06
.\" Generator: Asciidoctor 2.0.16
.\"      Date: 2021-08-03
.\"    Manual: FEX
.\"    Source: FEX
.\"  Language: English
.\"
.TH "FEX" "1" "2018-12-06" "FEX" "FEX"
.TH "FEX" "1" "2021-08-03" "FEX" "FEX"
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.ss \n[.ss] 0


@@ 43,7 43,9 @@ Extract syntax is one or more selectors, formatted as:
.sp
.if n .RS 4
.nf
.fam C
<delimiter><field number(s)|regexp>
.fam
.fi
.if n .RE
.sp


@@ 54,7 56,7 @@ You can specify multiple fields with curly braces and numbers split by commas.
Also valid in curly braces {} are number ranges. Number ranges are similar to
python array slices, split by colon.
.sp
The first delimiter is implied as space (\(aq \(aq), but can be overridden.
The first delimiter is implied as space (\*(Aq \*(Aq), but can be overridden.
For example, to select the last dash\-separated field, you can use \f(CR\-\-1\fP.
.sp
A selector\(cqs field number(s) (or regexp) can be written in the following ways:


@@ 69,8 71,10 @@ Example selecting third field:
.sp
.if n .RS 4
.nf
% echo "a b c d e" | fex \(aq3\(aq
.fam C
% echo "a b c d e" | fex \*(Aq3\*(Aq
c
.fam
.fi
.if n .RE
.sp


@@ 78,8 82,10 @@ Example selecting the second field delimited by slash:
.sp
.if n .RS 4
.nf
% echo "/home/hello/world" | fex \(aq/2\(aq
.fam C
% echo "/home/hello/world" | fex \*(Aq/2\*(Aq
hello
.fam
.fi
.if n .RE
.sp


@@ 94,8 100,10 @@ Example selecting first through fourth fields:
.sp
.if n .RS 4
.nf
% echo "a b c d e" | fex \(aq{1:4}\(aq
.fam C
% echo "a b c d e" | fex \*(Aq{1:4}\*(Aq
a b c d
.fam
.fi
.if n .RE
.sp


@@ 109,8 117,10 @@ Example selecting first and fifth fields:
.sp
.if n .RS 4
.nf
% echo "a b c d e" | fex \(aq{1,5}\(aq
.fam C
% echo "a b c d e" | fex \*(Aq{1,5}\*(Aq
a e
.fam
.fi
.if n .RE
.sp


@@ 125,8 135,10 @@ Example selecting fields 1 to 3, and 5: \f(CR{1:3,5}\fP
.sp
.if n .RS 4
.nf
% echo "a b c d e" | fex \(aq{1:3,5}\(aq
.fam C
% echo "a b c d e" | fex \*(Aq{1:3,5}\*(Aq
a b c e
.fam
.fi
.if n .RE
.sp


@@ 139,10 151,12 @@ N:M, so you can mix and match to reverse only a subset of fields. For example:
.sp
.if n .RS 4
.nf
% echo 1 2 3 4 | fex \(aq{<1:\-2,\-1}\(aq
.fam C
% echo 1 2 3 4 | fex \*(Aq{<1:\-2,\-1}\*(Aq
3 2 1 4
% echo 1 2 3 4 | fex \(aq{:,<:\-2}\(aq
% echo 1 2 3 4 | fex \*(Aq{:,<:\-2}\*(Aq
1 2 3 4 3 2 1
.fam
.fi
.if n .RE
.sp


@@ 153,19 167,21 @@ last field. In the second example, the fields are mirrored.
.RS 4
.RE
.sp
The {?...} notation turns on \(aqnon greedy\(aq field separation. The differences here
The {?...} notation turns on \*(Aqnon greedy\*(Aq field separation. The differences here
can be shown best by example, first:
.sp
.if n .RS 4
.nf
% echo "1...2.3.4" | fex \(aq.{1:3}\(aq
.fam C
% echo "1...2.3.4" | fex \*(Aq.{1:3}\*(Aq
1.2.3
% echo "1...2.3.4" | fex \(aq.{?1:3}\(aq
% echo "1...2.3.4" | fex \*(Aq.{?1:3}\*(Aq
1..
.fam
.fi
.if n .RE
.sp
In the first example, fex uses \(aq.\(aq as delimiter and ignores empty fields. In the
In the first example, fex uses \*(Aq.\*(Aq as delimiter and ignores empty fields. In the
second example (non greedy), it does not ignore those empty fields.
.sp
\fB/regexp/ (regular expression)\fP


@@ 174,13 190,15 @@ second example (non greedy), it does not ignore those empty fields.
.sp
The /regexp/ selection will choose only fields that match the given pattern.
.sp
Example, pulling out words with \(aqaddr:\(aq in it from \(aqifconfig\(aq output:
Example, pulling out words with \*(Aqaddr:\*(Aq in it from \*(Aqifconfig\*(Aq output:
.sp
.if n .RS 4
.nf
% printf \(aq%s: addr:%s\(rsn\(aq lo0 127.0.0.1 en0 10.1.0.24 | fex \(aq /addr:[0\-9]/\(aq
.fam C
% printf \*(Aq%s: addr:%s\(rsn\*(Aq lo0 127.0.0.1 en0 10.1.0.24 | fex \*(Aq /addr:[0\-9]/\*(Aq
addr:127.0.0.1
addr:10.1.0.24
.fam
.fi
.if n .RE
.sp


@@ 193,14 211,16 @@ read a reference for RE2 syntax at the site
.RS 4
.RE
.sp
The \(aqMTU\(aq in \f(CRifconfig\fP output looks like \(aqMTU:1500\(aq. So have fex split by
The \*(AqMTU\*(Aq in \f(CRifconfig\fP output looks like \*(AqMTU:1500\*(Aq. So have fex split by
space, then grab fields matching /mtu:/, split by colon, and choose the last
field.
.sp
.if n .RS 4
.nf
% ifconfig wlan0 | fex \(aq/MTU:/:\-1\(aq
.fam C
% ifconfig wlan0 | fex \*(Aq/MTU:/:\-1\*(Aq
1500
.fam
.fi
.if n .RE
.sp


@@ 209,14 229,16 @@ field.
.RE
.sp
Pull the IP address (first field by space) and the path requested (2nd field in
\(aqGET <path> ...\(aq).
\*(AqGET <path> ...\*(Aq).
.sp
.if n .RS 4
.nf
% fex 1 \(aq"2 2\(aq < /b/logs/access
.fam C
% fex 1 \*(Aq"2 2\*(Aq < /b/logs/access
65.57.245.11 /
65.57.245.11 /icons/blank.gif
65.57.245.11 /icons/folder.gif
.fam
.fi
.if n .RE
.SH "CONTACT"


@@ 224,14 246,15 @@ Pull the IP address (first field by space) and the path requested (2nd field in
You can file bugs, feature requests, or questions about the Go implementation at
the following URL:
.sp
.URL "https://github.com/nilium/go\-fex/issues" "" ""
.URL "https://todo.sr.ht/~nilium/tools" "" ""
.sp
Patches, discussion, ideas, issues, and so on are all welcome.
Patches, discussion, ideas, issues, and so on are all welcome. Patches may be
emailed to ~nilium/public\-inbox@lists.sr.ht.
.sp
You can send any of the above by email to \c
.MTO "ncower\(atgmail.com" "" " "
.MTO "ncower\(atnil.dev" "" ""
if you\(cqre more
comfortable with that.
comfortable with that or would like your contact to remain private.
.SH "DISCUSSION"
.sp
The Go implementation began as an almost\-verbatim translation of the original C


@@ 248,7 271,7 @@ expressions are case\-insensitive while the Go implementation\(cqs are not.
Related tools: \fBawk(1)\fP, \fBcut(1)\fP.
.sp
Project site: \c
.URL "https://github.com/nilium/go\-fex" "" ""
.URL "https://git.sr.ht/~nilium/go\-fex" "" ""
.sp
Original C fex project site: \c
.URL "https://www.semicomplete.com/projects/fex" "" ""