diff options
author | Magnar Sveen <magnars@gmail.com> | 2013-08-16 23:26:25 +0200 |
---|---|---|
committer | Magnar Sveen <magnars@gmail.com> | 2013-08-16 23:26:25 +0200 |
commit | 51dd56929056e52ac7b5646afce258a98e998869 (patch) | |
tree | 5bd17f1736898c4b275b4382c7a1fbf3ed069310 /s.el | |
parent | 8140902b14f347638361927c3aade6d28d180b0b (diff) |
Better support for international characters
Thanks to tailbalance of reddit
http://www.reddit.com/r/emacs/comments/1khq86/magnarssel_github_string_manipulation/
Diffstat (limited to 's.el')
-rw-r--r-- | s.el | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -285,7 +285,7 @@ This is a simple wrapper around the built-in `string-match-p'." "In S, is the first letter upper case, and all other letters lower case?" (let ((case-fold-search nil)) (s--truthy? - (string-match-p "^[A-ZÆØÅ][^A-ZÆØÅ]*$" s)))) + (string-match-p "^[[:upper:]][^[:upper:]]*$" s)))) (defun s-numeric? (s) "Is S a number?" @@ -404,9 +404,9 @@ When START is non-nil the search will start at that index." (defun s-split-words (s) "Split S into list of words." (s-split - "[^A-Za-z0-9]+" + "[^[:lower:][:upper:]0-9]+" (let ((case-fold-search nil)) - (replace-regexp-in-string "\\([a-z]\\)\\([A-Z]\\)" "\\1 \\2" s)) + (replace-regexp-in-string "\\([[:lower:]]\\)\\([[:upper:]]\\)" "\\1 \\2" s)) t)) (defun s--mapcar-head (fn-head fn-rest list) |