8

How should I modify the following such that the accented letter É is matched and the expression returns True?

StringMatchQ["Éta", RegularExpression["[a-zA-Z]+"]]
Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
user13253
  • 8,666
  • 2
  • 42
  • 65

1 Answers1

12

One possibility:

StringMatchQ["Éta", RegularExpression["[[:alpha:]]+"]]
Brett Champion
  • 20,779
  • 2
  • 64
  • 121
  • On the Documentation page for RegularExpression I see only listing of named classes of characters: alnum, alpha, ascii, blank, cntrl, digit, graph, lower, print, punct, space, upper, word, xdigit. Some of them have self-explanatory names like ascii, digit etc. but some (like alpha) have not obvious meanings. Where can I learn about them? – Alexey Popkov Jan 16 '13 at 10:36
  • 3
    @AlexeyPopkov here, in the section, "POSIX character classes". – Oleksandr R. Jan 16 '13 at 10:50