How do I use the FOR batch command to find all text between two specific symbols?
问题 I have a batch script I made to extract chat lines from a log on my gaming server. The input file has text lines like this: 12/30/2015 12:42:03 : #[PLAYERNAME] Hello! I then process each line of the log to extract the player name as follows: for /f "tokens=2 delims=[]" %%d in ("!LINE!") do (set "NAME=%%d") This works fine IF the player has no [] bracket characters in their name. If their name looks like the following: 12/30/2015 12:42:03 : #[<][PLAYERNAME][>] Hello! Or anything similar, then