I can use \\p{Punct} to match all punctuations(including underscore).
And I wanted to exclude all apostrophes strictly inside a word.
You can combine three conditions here.
Match all punctuation except apostrophe ' using [\p{Punct}&&[^']]
Match all apostrophe not followed by a letter.
Match all apostrophe not preceded by a letter.
Regex: [\p{Punct}&&[^']]|(?
Explanation:
[\\p{Punct}&&[^']] excludes apostrophe from punctuation class.
(? matches apostrophe not preceded by a letter.
'(?![a-zA-Z]) matches the apostrophe not followed by a letter.
RegexPlanet Fiddle