in reply to complex pattern matching

This one seems to work, but I dumped the \b operator for \w[^'\w]+ This works on
input and input and 'input' and 'tinput' and notinput and ' input ' and 'input ' and input producing
OUTPUT and OUTPUT and 'input' and 'tinput' and notinput and ' input ' and 'input ' and OUTPUT

<code> s/((?:^|\w[^'\w]+))input((?:[^'\w]+\w|$))/$1OUTPUT$2/g; <code>

Update: whoops, missed a certain point; thought that if input was contained in single quotes, don't substitute. As far as I can tell tachyon's got it, though I did learn more about captures and clusters