View Single Post
Old 10-14-2011, 02:22 PM   #5
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by mmholt View Post
Enlighten me, please?
Code:
Search for: (\w\.) (?=\w\.)
Replace with: \1
\w is a single word character (like a letter)
\w\. is a single word character followed by a period (the \. means a period, while the dot alone without the escape backslash is a wild card for any character.)
So "(\w\.) " means a single word character followed by a period followed by a space (note the space there).

(?=\w\.) means to only find "a single word character followed by a period followed by a space" if the space is followed by "a single word character followed by a period". The pattern (?= 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.

For example, the regex "Isaac (?=Asimov)" will match "Isaac " only if it’s followed by "Asimov".

Last edited by Starson17; 10-14-2011 at 02:27 PM.
Starson17 is offline   Reply With Quote