Regex: match words with or without hyphens and apostrophes

spiros

  • Administrator
  • Hero Member
  • *****
    • Posts: 812013
    • Gender:Male
  • point d’amour
Regex: match words with or without hyphens and apostrophes

[\w'-]+

or

(?=\S*['-])([a-zA-Z'-]+)

Match any ASCII word with 3 or more characters with or without hyphens and apostrophes
([a-zA-Z'-]+){3,}
« Last Edit: 18 May, 2020, 17:00:16 by spiros »


 

Search Tools