Skip to content

Commit

Permalink
Letters can be neither upper or lower case. Handle it.
Browse files Browse the repository at this point in the history
  • Loading branch information
magnars committed Aug 24, 2013
1 parent 98c0956 commit f3fe06e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dev/examples.el
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion s.el
Expand Up @@ -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"
Expand Down

0 comments on commit f3fe06e

Please sign in to comment.