Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    Seriously? U+0001 START OF HEADING or U+0007 BELL is fine, but plain English isn't? Are you sure that ASCII is what you want to match for? Commented Aug 24, 2010 at 23:47
  • Come on, why are you hating on \a. It's great. But yes, seriously. Last time I checked none of those interferes with page rendering like the mirror char or some of the others. Commented Aug 24, 2010 at 23:52
  • 1
    é doesn't mess with a page either. If messing with page rendering is the issue, then maybe use \p{C}. new Regex(@"\p{C}").Replace(suspect, string.Empty) will clear out both ASCII and non-ASCII controls and formatters, while not damaging normal text a more naïve (or as you would have it, nave) approach would mangle. Particularly if you have names or people or places appearing anywhere (proper names being both places where non-ASCII letters crop up a lot in English, and places where users get particularly upset if you mangle them). Commented Aug 25, 2010 at 0:28
  • ï is ASCII, you know ;-) Commented Aug 25, 2010 at 16:20
  • I just stumbled into this very problem, and for some frameworks, such as ASP.NET MVC, the answer is not exactly a simple exclusion regex - see here for more: nimblegecko.com/… Commented Mar 11, 2016 at 7:55