View Single Post
Old 03-25-2013, 06:19 PM   #7
ElMiko
Addict
ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.
 
ElMiko's Avatar
 
Posts: 320
Karma: 56788
Join Date: Jun 2011
Device: Kindle
Quote:
Originally Posted by DiapDealer View Post
I'm not certain I'm entirely following. In your pseudo-regex:
Code:
(?<=\bI)[non-space, non-character](?=m\b)
You seem to want to match the position in between Im (with word boundaries on either side) so you can replace that captured "position" with an apostrophe. But if you're basically going to run a search for "Im"... then why not just replace all instances of \bIm\b with "I'm". Or \b((?i)c)(?-i)ant\b with "\1an't" ? Shouldn't take too long to go through most of the common contractions.
... because there are actually lots of contractions. And typing each search out and a unique replace value would take a longer than doing what i'm trying to do. Obviously, it can be done the way you are suggesting—it's the way I've done it in the past... it hardly even counts as "RegEx".
ElMiko is offline   Reply With Quote