diff options
author | Magnar Sveen <magnars@gmail.com> | 2013-02-16 16:11:09 -0800 |
---|---|---|
committer | Magnar Sveen <magnars@gmail.com> | 2013-02-16 16:11:09 -0800 |
commit | 02113f1bd0bd621c1dd60c64f511f5fb043712fb (patch) | |
tree | 3666bfd2ec5e6cbde6d914de152268bfd32c3e38 /dev | |
parent | f30f5a9aed82700462c44772028ae55851e72b56 (diff) | |
parent | 33ed0e057e3cabde112a282edf3523748e19d056 (diff) |
Merge pull request #21 from ruediger/s-match
s-match: START parameter
Diffstat (limited to 'dev')
-rw-r--r-- | dev/examples.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/dev/examples.el b/dev/examples.el index 34a9957..d2462dc 100644 --- a/dev/examples.el +++ b/dev/examples.el @@ -114,7 +114,9 @@ (s-match "^/.*/\\([a-z]+\\)\\.\\([a-z]+\\)" "/some/weird/file.org") => '("/some/weird/file.org" "file" "org") (s-match "^\\(abc\\)\\(def\\)?" "abcdef") => '("abcdef" "abc" "def") (s-match "^\\(abc\\)\\(def\\)?" "abc") => '("abc" "abc") - (s-match "^\\(abc\\)\\(def\\)?\\(ghi\\)" "abcghi") => '("abcghi" "abc" nil "ghi")) + (s-match "^\\(abc\\)\\(def\\)?\\(ghi\\)" "abcghi") => '("abcghi" "abc" nil "ghi") + (s-match "abc" "abcdef" 1) => nil + (s-match "abc" "abcdefabc" 2) => '("abc")) (defexamples s-split (s-split "|" "a|bc|12|3") => '("a" "bc" "12" "3") @@ -135,7 +137,9 @@ (defexamples s-matches? (s-matches? "^[0-9]+$" "123") => t - (s-matches? "^[0-9]+$" "a123") => nil) + (s-matches? "^[0-9]+$" "a123") => nil + (s-matches? "1" "1a" 1) => nil + (s-matches? "1" "1a1" 1) => t) (defexamples s-blank? (s-blank? "") => t |