Need to extract computer names from a text file


i have text file has computer names need extract from, text file has ton of other non-essential data in don't care use. 

all computer names follow naming convention there 5 6 characters hyphen , either 2 or 3 numerical characters. 

so, naming standard this:

abcw7-01 or abcw7d-100

anyway, how may go extracting these using regex?

thanks

okay, think found it. 

it appears able extract info needed using following regex pattern:

'\w+-\d+'



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Motherboard replacement

Cannot create Full Text Search catalog after upgrading to V12 - Database is not fully started up or it is not in an ONLINE state

Remote Desktop App - Error 0x207 or 0x607