I'm trying to pull text out of a word document using regex look ahead and look behind foudn in this answer:
Regular Expression to find a string included between two characters while EXCLUDING the delimiters
The delimeters I have to work with are
Start: RQ
End: END-RQ
I have added the following (powershell) code:
$regex = [regex] '(?<=RQ)(.*?)(?=END-RQ)'
$matches = $regex.Matches($concat)
The problem is the matching is grabbing the RQ from END-RQ as the beginning of the next pattern. Can anyone tell me how to eliminate that (e.g. force the regex to match exactly RQ and END-RQ)? Wrapping the matching patterns in quotes does not seem to work, even when the quotes are escaped.