import retext = "'text... 'some quotes', there's none'. three 'four' can't, '2'4', '_'_', 'l'école'"print( re.sub(r"(?!\b'\b)'", "", text) )print( re.sub(r"'(?!(?<=[a-zA-Z]')[a-zA-Z])", "", text) )print( re.sub(r"'(?!(?<=[^\W\d_]')[^\W\d_])", "", text) )
Standard input is empty
text... some quotes, there's none. three four can't, 2'4, _'_, l'école text... some quotes, there's none. three four can't, 24, __, lécole text... some quotes, there's none. three four can't, 24, __, l'école
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!