Regex Help Please

1    14 Jul 2015 17:00 by u/skaiinyght

Hey all, I'm having trouble figuring out how to write this regex.

I am supposed to find all occurences of the word 'is' and replace them with is not. There may not be any letters to the side of 'is' but there can be spaces and special characters.

What I currently have is [^A-Za-z]?[Ii][Ss][^A-Za-z]

sample input:

is test

is-is

This is right

expected output:

is not test

is not-is not

This is not right

actual output:

is not test

is not is not

This no is not

How would I write this regex?

1 comment