octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #57107] regexp functions fail on ISO-8859-1 in


From: Qianqian Fang
Subject: [Octave-bug-tracker] [bug #57107] regexp functions fail on ISO-8859-1 input
Date: Sun, 18 Jun 2023 17:23:25 -0400 (EDT)

Follow-up Comment #39, bug #57107 (project octave):

if the pattern to be matched is ASCII only, does regexp really care if the
input must be a valid string? can you give me a counter example when it
matters?

also, this workaround only works if the matching string is located at the
start of the input. I have a toolbox parsing/writing
(https://github.com/fangq/jsonlab) binary JSON
(https://json.nlohmann.me/features/binary_formats/bjdata/), where ascii keys
and binary data are mixed. Regexp could be a powerful tool for efficiently
processing/parsing such data. For example, this works in matlab to
locate/count double-typed elements in the buffer:

dat=struct('a',pi, 'b',[], 'c',struct('d',[1,2],'e',12))
regexp(savebj('',dat,'ArrayToStruct',1),'U._ArrayType_SU.double')

or

regexp(savebj('',dat,'ArrayToStruct',1),'U[\x0B]_ArrayType_SU[\x06]double')

but now it fails in octave.

needless to say, from a code maintenance perspective, the proposed workaround
not only made the code difficult to read, difficult to generalize and, one has
to separately handle MATLAB and octave.

is matching MATLAB's function behavior no longer a priority for octave
development?


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57107>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]