I have a paragraph of text read from a file using C# File.ReadAllText(). Say this was my output:
See [a car] is a wheeled, self-powered motor vehicle used for transportation
and a product of the automotive industry.
Most definitions of the term specify that [a car] is designed to run
primarily on roads, to have seating for one to eight people, to typically
have four wheels with tyres
I want to match and replace the phrase "a car" but only the SECOND occurrence with "test string". Brackets [ ] added for easier reading but they are not really present within the file text. The regexes I've seen on StackOverflow only replace a character/word within a string that has no line breaks. How can I search an entire paragraph of text and do a regex replace on the second occurrence of a phrase?