[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: FQDN Pattern/regex LUA help
- From: Hartmut Henkel <hartmut_henkel@...>
- Date: Tue, 27 Dec 2022 11:38:24 +0100 (CET)
On Tue, 27 Dec 2022, vale.gua wrote:
> s = os.getenv("HOSTNAME") to catch the FQDN, therefore the result is:
> vimhost-axzh9a.ch.bwww.com
> Is possible, with LUA, to cut from FQDN:
> vimhost-
> and
> .ch.bwww.com
local s = "vimhost-axzh9a.ch.bwww.com"
local h1, h2, h3 = string.match(s, "([^%-]+)%-([^%.]+)%.(.+)")
print(h1, h2, h3)
Best Regards
Hartmut