What is a regular expression for
initSock|north|router\r\n
Where there is north changes all the time but the rest is always the same. So It can be:
initSock|foo|router\r\n initSock|bar|router\r\n
etc.
But where north, foo or bar are there definitely should be something and can’t be empty. I am going to use this in C#.
To make it more clear: Any thing that looks like this is bad:
initSock||router\r\n initSockfoorouter\r\n |foo|router\r\n initSock|foo|router initSock|foo|portal\r\n outSock|foo|router\r\n
To extend the above answer from M Potato Head to allow for all possible characters I’d rewrite the regexp as:
or
if you can’t use extended regexp. That way you don’t have to ensure that you’ve allowed for all possible chars in the set of characters that you’re using to match the varying part of the name.
HTH
cheers,
Rob