Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Letters can be neither upper or lower case. Handle it.

  • Loading branch information...
commit f3fe06e782f79211eebf722610bbd9413a12c1c9 1 parent 98c0956
@magnars authored
Showing with 4 additions and 2 deletions.
  1. +3 −1 dev/examples.el
  2. +1 −1  s.el
View
4 dev/examples.el
@@ -341,7 +341,9 @@
(s-split-words "!map (fn list)") => '("map" "fn" "list")
(s-split-words "Привет, мир") => '("Привет" "мир")
(s-split-words "e é è e") => '("e" "é" "è" "e")
- (s-split-words "MANYUpperCases") => '("MANY" "Upper" "Cases"))
+ (s-split-words "MANYUpperCases") => '("MANY" "Upper" "Cases")
+ (s-split-words "Приве́т") => '("Приве́т")
+ (s-split-words "漢語") => '("漢語"))
(defexamples s-lower-camel-case
(s-lower-camel-case "some words") => "someWords"
View
2  s.el
@@ -404,7 +404,7 @@ 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
- "[^[:lower:][:upper:]0-9]+"
+ "[^[:word:]0-9]+"
(let ((case-fold-search nil))
(replace-regexp-in-string
"\\([[:lower:]]\\)\\([[:upper:]]\\)" "\\1 \\2"
Please sign in to comment.
Something went wrong with that request. Please try again.