How would I write a regular expression (C #) that will check the given string to see if any of its characters have OTHER characters than the following:
ahAZÆ æ Å ø Ø ø - '
new Regex("[^a-zA-ZÆæÅ娸'-]")
[] creates a character class, then ^ indicates the negation, so the character corresponds to the class if it is not one of those listed.
[]
^
To achieve this, you can use character grouping in combination with the negation operator.
You also need to escape the character - (and possibly ') by using \
Your final expression will read:
[^ A-Za-ZÆæÅ娸 \ - \ '] *
Source: https://habr.com/ru/post/1311293/More articles:What is the most efficient way to compare strings? - c #Difference between performSelectorInBackground and NSOperation - multithreadingIs the numeric keypad turned off? - iphoneXPATH: select a subset of the xml file - javaDoes HWID block a PHP page? - authenticationHow to create RouteUrls with data binding parameters declaratively? - asp.netCan GET and POST requests from the same computer come from different IP addresses? - http-getCreating jQuery dynamic hints for dynamic content - jqueryiPhone: cached profile images from the Internet - how do I know if a deleted image has changed? - cachingHow to set key binding to make Emacs transparent / opaque as I want? - emacsAll Articles