Quote:
Originally Posted by theducks
I think that should be (a back reference for each match)
\1\2
Since the spac between other match elements is not in side a reference (), it will be lost when replacing only the 2 back references.
|
Actually, I think the way it works is that the entire regex ONLY matches the first occurence of a single word character followed by a period and space.
Since the (?=\w\.) is as chaley says "(?= is a positive lookahead assertion. It lets the preceding match only when the following matches, but the lookahead part doesn't "eat up" any of the string." this means the only characters "consumed" by the reg ex. are the initial sequence "(\w\.) " and that is replaced by the (1) which is that initial \w\. sequence.