mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-12 22:42:23 +00:00
Minor cleanup
This commit is contained in:
parent
b589726352
commit
cb09dff9f1
@ -3,7 +3,7 @@ module BytesRegex
|
||||
|
||||
class Regex
|
||||
def initialize(pattern : String, multiline = false, dotall = false, ignorecase = false, anchored = false)
|
||||
flags = LibPCRE2::UTF | LibPCRE2::DUPNAMES | LibPCRE2::UCP | LibPCRE2::NO_UTF_CHECK
|
||||
flags = LibPCRE2::UTF | LibPCRE2::UCP | LibPCRE2::NO_UTF_CHECK
|
||||
flags |= LibPCRE2::MULTILINE if multiline
|
||||
flags |= LibPCRE2::DOTALL if dotall
|
||||
flags |= LibPCRE2::CASELESS if ignorecase
|
||||
@ -40,9 +40,7 @@ module BytesRegex
|
||||
LibPCRE2::NO_UTF_CHECK,
|
||||
@match_data,
|
||||
nil)
|
||||
if rc < 0
|
||||
# No match, do nothing
|
||||
else
|
||||
if rc > 0
|
||||
ovector = LibPCRE2.get_ovector_pointer(@match_data)
|
||||
(0...rc).each do |i|
|
||||
m_start = ovector[2 * i]
|
||||
|
Loading…
Reference in New Issue
Block a user