Commit Graph

133 Commits

Author SHA1 Message Date
Flaviu Tamas
d71297d7dc Merge pull request #13 from flaviut/better-exceptions
Better handle errors
2015-05-04 18:11:44 -04:00
Flaviu Tamas
ba0b9e26c6 Better handle errors
Fixes #7
2015-05-04 16:47:31 -04:00
Flaviu Tamas
90d17c4e03 Improve performance
Removing ANCHORED means that after findIter is unable to find any more matches,
it doesn't bother searching unless there are some promising 0-len matches. This
significantly improves performance on problems like
`"abccccccccccccc".find(re"a")`. Previously, each "c" would require a call to
pcre_exec, which would iterate over [index_of_c..string.len], a O(n^2) process!
2015-04-12 10:33:21 -04:00
Oleh Prypin
8b8224ecaf Add tests for empty or non-empty match 2015-04-12 17:31:43 +03:00
Oleh Prypin
02c6e7306f Fix skipping an empty match at the end 2015-04-12 15:18:16 +03:00
Flaviu Tamas
ec1758509c Add longer flags
It is now possible to use longer flags instead of the short one-letter ones.
2015-04-11 14:17:53 -04:00
Flaviu Tamas
4ce267c08d Fix getinfo overflows 2015-04-11 11:15:51 -04:00
Flaviu Tamas
bc27d06e39 Use docweave
The readme file is now generated from the contents of the nre module.
2015-04-11 10:55:50 -04:00
Flaviu Tamas
0dc86145ea Convert readme to RST 2015-04-11 08:51:33 -04:00
Flaviu Tamas
4b42ddfdfa Fix result shadowing warning 2015-04-10 14:01:05 -04:00
Flaviu Tamas
62a8ab9006 Throw an exception when replacing with a nil value 2015-04-10 13:54:24 -04:00
Flaviu Tamas
e6d662e6b9 Fix potential buffer overflow
Under certain circumstances, it would be possible for a too-large number sent
cause a buffer overflow by passing a too-large endpos.
2015-04-10 13:18:08 -04:00
Flaviu Tamas
eca9597635 Merge pull request #10 from BlaXpirit/fix-skip-zero
Fix zero-length matches for multibyte characters
2015-04-10 09:44:54 -04:00
Oleh Prypin
16577f8167 Fix zero-length matches for multibyte characters 2015-04-10 15:34:22 +03:00
Flaviu Tamas
a665279192 Merge pull request #9 from BlaXpirit/master
Make splitting an empty string give 1 empty result
2015-04-09 17:23:03 -04:00
Oleh Prypin
1fe69b94c9 Make splitting an empty string give 1 empty result 2015-04-10 00:19:00 +03:00
Flaviu Tamas
6c213802f0 Merge pull request #8 from BlaXpirit/incl-indices
Change capture upper bounds to inclusive
2015-04-09 17:15:34 -04:00
Oleh Prypin
2f0375c4c8 Change endpos to inclusive 2015-04-09 23:51:17 +03:00
Oleh Prypin
7e44c08270 Change endpos default from -1 to int.high 2015-04-09 23:51:06 +03:00
Oleh Prypin
4e83fc5867 Change capture upper bounds to inclusive 2015-04-09 23:49:50 +03:00
Flaviu Tamas
bdd8567f50 Add CircleCI 2015-04-09 16:18:25 -04:00
Flaviu Tamas
eb117e239f Adjust readme formatting
- Add table of contents
- Move image to bottom
2015-03-30 19:42:48 -04:00
Flaviu Tamas
763e902b65 Remove renderBounds()
A debug proc, it's not really useful and throws warnings anyway.
2015-03-05 10:42:37 -05:00
Flaviu Tamas
e5e5970d93 Fix broken logic in 7296c6d
Thanks @fowlmouth for pointing this problem out in IRC.
2015-03-04 21:45:56 -05:00
Flaviu Tamas
ab6e83ad41 Fix tests broken in 7296c6d
7296c6d doesn't do any nil checking, so it segfaults on `==` on `Regex`
2015-03-04 19:29:35 -05:00
Flaviu Tamas
b556bd9abf Fix "could not import: pcre_stack_guard"
kanaka/mal#20 related, seems like some systems have older PCREs, without
pcre_stack_guard. Since it isn't expclitly used, this will *hopefully* prevent
errors from occurring.
2015-03-04 19:15:53 -05:00
Flaviu Tamas
7296c6d649 Add equality operator for RegexMatch and Regex
- Technically a breaking change, but I doubt anyone depends on a compile-time
  error for long ;)
2015-03-03 18:48:35 -05:00
Flaviu Tamas
cba3b788f1 Add more details about modifier syntax
See discussion on #4 for details.
2015-02-11 14:05:52 -05:00
Flaviu Tamas
5cbaa1ba37 Remove unnecessary filter
The things it was filtering do not need to be filtered
2015-02-07 13:19:43 -05:00
Flaviu Tamas
7191869d09 Use /bin/sh
Apparently /usr/bin/sh only works in Arch Linux
2015-02-07 09:46:03 -05:00
Flaviu Tamas
18a401886d Bump version number 2015-01-31 18:08:22 -05:00
Flaviu Tamas
bc37a33853 Update documentation 2015-01-31 18:08:22 -05:00
Flaviu Tamas
a1110ebb14 Change RegexMatch from ref to Option
Also associated changes to tests and code
2015-01-31 18:05:49 -05:00
Flaviu Tamas
43127455cb Remove match cache 2015-01-28 20:19:35 -05:00
Flaviu Tamas
85d71da595 Bump version 2015-01-24 14:58:44 -05:00
Flaviu Tamas
a064faf171 Allow custom test parameters 2015-01-24 14:58:25 -05:00
Flaviu Tamas
e027ea9139 Add start to split 2015-01-24 14:58:09 -05:00
Flaviu Tamas
ba3aac1b13 Bump version 2015-01-21 21:08:15 -05:00
Flaviu Tamas
e8d04e142e Fix build on windows
Issues including "pcre.h", but it's not needed anyway! I can just get rid of it.
2015-01-21 16:34:21 -05:00
Flaviu Tamas
9a7ec44d96 Add logo 2015-01-20 21:17:45 -05:00
Flaviu Tamas
1a76edbe02 Add dynlib option 2015-01-20 21:04:24 -05:00
Flaviu Tamas
91233dfab9 Elaborate on UCP 2015-01-20 20:12:20 -05:00
Flaviu Tamas
256435e8e3 Fix incorrect property check 2015-01-20 18:23:54 -05:00
Flaviu Tamas
7c24290eec Enable UTF and UCP support in PCRE 2015-01-20 18:14:24 -05:00
Flaviu Tamas
f6b6a429ff Bump version number 2015-01-19 16:40:32 -05:00
Flaviu Tamas
eb2fd618fe Fix accidental negative bounds
See Araq/Nim #1979 for context
2015-01-19 16:16:06 -05:00
Flaviu Tamas
b5f3a662c5 Bump version number 2015-01-19 16:04:53 -05:00
Flaviu Tamas
5ae3010e5a Clarify replace(...)'s behavior on nil 2015-01-19 16:04:53 -05:00
Flaviu Tamas
78afa73e01 Add replace(proc(string): string) 2015-01-19 16:04:53 -05:00
Flaviu Tamas
f34a7dc1f5 Make replace a template
Also required me to fix a name conflict with the format template
2015-01-19 16:04:21 -05:00