Forum Discussion
Matt_Breedlove_
Nimbostratus
Jun 24, 2014Help with Scan or String first last and multiple/last occurence
Need some help trying to always match the string immediately preceding the first period and delimited by the leading dash
So given these hostnames, the desired match is indicated...I would be wanti...
Kevin_Stewart
Employee
Jun 26, 2014You could also use a regex:
set str "test-tools-config.acme.com"
set foo [string range [regexp -inline {\-[^-.]+\.} $str] 1 end-1]
log local0. $foo
Grab the part of the string that starts with a dash, ends with a period, and does not contain either in the middle, then strip the dash and period from the resulting string.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
