another PCRE try
svn: r4322
This commit is contained in:
parent
ce0ad68956
commit
2534d8a3a5
|
@ -7,7 +7,7 @@
|
|||
|
||||
(define pcre-compile
|
||||
(get-ffi-obj "pcre_compile" pcre-lib
|
||||
(_fun _bytes _int _pointer _pointer _pointer
|
||||
(_fun _bytes _int _bytes _bytes _pointer
|
||||
-> _pointer)))
|
||||
(define pcre-study
|
||||
(get-ffi-obj "pcre_study" pcre-lib
|
||||
|
@ -19,13 +19,13 @@
|
|||
_int _int _bytes _int
|
||||
-> _int)))
|
||||
|
||||
(define random-vector (make-bytes 100))
|
||||
|
||||
(define (pcregexp s)
|
||||
(let* ([pat (pcre-compile s 0 #f #f #f)]
|
||||
(let* ([pat (pcre-compile s 0 random-vector random-vector #f)]
|
||||
[extra #f #;(pcre-study pat 0 #f)])
|
||||
(cons pat extra)))
|
||||
|
||||
(define random-vector (make-bytes 100))
|
||||
|
||||
(define (pcregexp-match re bytes)
|
||||
(pcre-exec (car re) (cdr re) bytes (bytes-length bytes)
|
||||
0 0 random-vector 10))
|
||||
|
|
Loading…
Reference in New Issue
Block a user