in reply to Re^3: How do I display only matches
in thread (SOLVED) How do I display only matches

My problem is to detect directories which are out of order. The proper order of the tree should read as follows:

Directory of D:\ \Q Directory of D:\ \R Directory of D:\ \S

Due to operator mishandling, the directories can look more like this:

12345678901234567890 Directory of D:\ \Q Directory of D:\ \Q\X Directory of D:\ \R Directory of D:\ \S

I need to identify the anomalies like \Q\X. FINDSTR doesn't work, so I was able to come up with the regex \.{20}\\a-zA-Z\s\r\n/ There will always be 20 characters followed by a backslash, then a letter, then a space, and then a CRLF. The regex is accurate because it works in the online regex tester https://regex101.com/r/LFrvLp/11

I have zero experience with perl scripting, I was looking for code to read a file and found the snippet with the "chomp" function. All I want is to read an input file and output a list of matches for the regex. Thank you for your assistance!