-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add examples for Re.split function #216
Conversation
Looks like the build is failing due to the dependency on |
lib/core.mli
Outdated
@@ -280,6 +280,22 @@ val split : ?pos:int -> ?len:int -> re -> string -> string list | |||
# Re.split ~pos:3 regex "1,2,3,4. Commas go brrr.";; | |||
- : string list = ["3"; "4. Commas go brrr."] | |||
]} | |||
|
|||
Be careful when using [split] with zero-length patterns like [eol], [bow], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you should explain what to be careful about, as it's kind of vague even with the examples. I get the general idea, but I think this could be explained in more detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added more details in the latest commit.
dddd801
to
528a3fe
Compare
Any interest in this PR? If so I could resolve the conflicts, if not, I will close it. |
Sure, I think this PR is useful. Ping me when it's ready and I'll merge. |
ac26ae9
to
0edc5f9
Compare
Thanks @rgrinberg, I rebased, and added corresponding examples to the |
Thanks! |
Adds a few examples of using zero-length patterns as inputs to Re.split. Examples are taken from the test suite. Related to #119 and #120.
I know it is an old issues (this one: #119), but I also tried to use the
eol
as input forsplit
in the past. So, I took a couple of the test cases and added them to the examples forRe.split
.