Ask Your Question

match expression in node definition

asked 2014-10-02 18:25:46 -0600

stecino gravatar image


I have servers names that have the following pattern:

What kind of regex can I use in node definition to match this pattern?


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-10-03 07:31:01 -0600

llowder gravatar image

It depends on what the important part is. And given a single sample, it is difficult to tell.

I'm guessing the blah part is the important part, with the d1 part indicating either an enviroment, datacenter or cluster or something.

In that case, something like node /[a-z][\d]blah/ { will do the trick and you can just replace blah as needed.

If you can provide more details and more samples, a better answer can be provided. I'd also suggest that you visit rubular and you can test different regexes to see what would match.

edit flag offensive delete link more

answered 2014-10-06 20:32:33 -0600

stecino gravatar image

that's correct: d1=dev1 environment

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-10-02 18:25:46 -0600

Seen: 256 times

Last updated: Oct 06 '14