Re: FQDN Pattern/regex LUA help
[
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: 2022年12月27日 11:38:24 +0100 (CET)
On 2022年12月27日, 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