Relevance to remove characters

I am writing relevance to pull certain information out of a file. Using regex I am able to remove the first matches, but what I am attempting to do is remove some trailing characters I do not need.

File 123 contains the line AvengersAssemble 1.2.3.456789-456789-xyz. The relevance I wrote is as follows…

if (exists file “/abc/def/123”) then (first matches (regex “[^\ ]+”) of following texts of firsts "AvengersAssemble " of lines starting with “AvengersAssemble” of file “/abc/def/123”) else “n/a”

So all I want to capture out of the file is 1.2.3.456789.

Any thoughts on how to not capture everything after the 9?

consider a different regex?

q: first matches (regex “\d{1,4}.\d{1,4}.\d{1,4}.\d{1,9}”) of "AvengersAssemble 1.2.3.456789-456789-xyz: other stuff"
A: 1.2.3.456789

q: first matches (regex “\d{1,4}.\d{1,4}.\d{1,4}.\d{1,9}”) of "AvengersAssemble 1234.2345.3456.456789123456-456123123789-xyz: other stuff"
A: 1234.2345.3456.456789123

Here is the relevance that I got to function…

first matches (regex “[^ -]+”)… in place of this first matches (regex “[^\ ]+”)

Found this site that helped me with regex parameters/characters…
http://www.rexegg.com/regex-quickstart.html#chars

1 Like

I considered an alternate version: following texts of first " " of preceding texts of firsts “-” of “AvengersAssemble 1.2.3.456789-456789-xyz”

Inline replacement would be something like: following texts of first " " of preceding texts of firsts “-” of (if (exists file “/abc/def/123”) then (first matches (regex “[^\ ]+”) of following texts of firsts "AvengersAssemble " of lines starting with “AvengersAssemble” of file “/abc/def/123”) else “n/a”)

Not up to snuff on regex yet so it depends on how your file search with that functions, but trimming answers is super easy.