what's a good regex for replacing ' followed by any character

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rotaryfreak
    New Member
    • Oct 2008
    • 74

    what's a good regex for replacing ' followed by any character

    Hi,

    I've been trying to parse words like it's, can't, etc. so that all i'm left with is the root word i.e it for the word it's and can for the word can't.
    This is what i have tried so far:

    Code:
    String regex = "('.*$)|('[a-z]+)|('(\\w)+)";
    sadly, nothing is working... what am i doing wrong?

    thx
Working...