I have following values:
Thomson SpeedTouch ST510 V6 versao 18.104.22.168 or ST585 v6,
D-LINK DSL-500B Geracao II,
COMTREND-COMTREND CT-5072S ,
I need to extract only first word like:Thomson,D-LINK,COMTREND.Can any one help me in writing regex to this.
This might be helpful
this is the link for Automatic generation of rex
Watch this video
if the needed words are always the first words at the start of a new line, use this:
... | rex "^(?<myField>\w+(\s|-LINK|))" | table myField
This will get you a table of
hope this helps ...
It's a bit ugly to have the dash sometimes be part of the word (D-LINK) and sometimes serve as a word separator (COMTREND-COMTREND) - if your list of such exceptions is large then you'll have to build a large regex.