in reply to Partial string match -- with a twist.
What I need is to pull JUST the node key (which is variable based on how many servers are entered...could be node0-node199). [emphases added]
From the quote from the OP and from the examples therein, I get the notion that the pattern is best described as "the literal 'node' at the start of a string, immediately followed by 1 to 3 (and no more) decimal digits". The regex /(node[0-9]*)/ matches 'node' anywhere, followed by any number (including zero) of digits. IMHO, a better (because more specific) regex would be
m{ \A (node \d{1,3}) (?! \d) }xms
(which has not been tested).
|
|---|