Regex Help Split Host and Domain name from a string

Hi

Please can have some assistance with a regex. I would like to split the hostname and domain name from the following example text.

hostname.lan.domain.co.uk.

Thank you

Hi @Richard ,

Is this text part of the body of the email, or will it be in the from-address, subject, or somewhere else?

Hi @travis

The original line is from the body of the email, below

You’re receiving this email because a Backup failure alert has been activated for hostname.lan.domain.co.uk.

What I trying to is extract the server name and domain, then search for the configuration item for the device.

Hope that give you more information.

Thank you

Perfect, thanks.

I would recommend a text helper instead of a regular expression because it is simpler. I would use:

{{between_strings email.body "You’re receiving this email because a Backup failure alert has been activated for " "." flags="t"}}

This will locate the text after “… has been activated before” and will stop at the first period. In your example, it would return hostname.

Does that look the extract you’re looking for?

Thank you, that works. How would I force the case in the string result to all lower case for example.

There’s no method by which to convert the string to lower-case. But, the query to Autotask is case-insensitive, so it shouldn’t affect the results.