Walker News

Using Findstr With Regular Expression For Pattern Search

The findstr command comes with Windows supports regular expression, which is useful for filter out useful information in text content.

For example, when using netsh command to analyze WIFI channel and signal of each SSID, the command output will be lengthy when the WLAN adapter detects dozens of AP signals. It also contains additional info that is not needed for that particular analysis.

So, to filter out WIFI channel and signal of respective SSID, we create a Windows batch file with two lines:
netsh wlan show networks mode=bssid |^
findstr /I /R "^ssid channel signal"

The netsh command output is piped to findstr command to perform case insensitive search (i.e. /I option) using regular expression (i.e. /R option).

NOTE: The findstr regular expression uses spaces to separate multiple search strings unless the argument is prefixed with /C option. Therefore, the following regular expression pattern works for GNU grep command but it is NOT working in findstr command:

In additional, findstr ignores /C option when /R option is used. To find out more info about findstr command syntax and its regular expression syntax, type findstr /?.

Custom Search

2017  •  Privacy Policy