--- In [email protected], "Sheri" <sheri...@...> wrote: > > --- In [email protected], "entropyreduction" > <alancampbelllists+yahoo@> wrote: > > > > > > --- In [email protected], "Sheri" <sherip99@> wrote: > > > > > > > I think if a user vector handle is provided, something should now > > > > > go into it even if there is no "offsets" option. Ditto if a > > > > > variable name is provided. > > > > > > > > Uh..so what goes into variable if present? First element in > > > > vector returned by pcre_exec? > > > > > No, a string from first element (offset) to the second element > > > (offset) in the subject. The second element will have the offset > > > of end of the subject. The user would need to prepend this string > > > onto the beginning of the next segment to continue searching for > > > a match. > > > > That sounds like what's meant to go into vector. > > > > Do I respect "nocaptures" option if present and not return > > matched subject substring? > Yes
Okay. > > I assume you want that substring to go into variable if named? > Yes Okay > > Can I assume that pcre_exec will always return an empty vector if > > PCRE_ERROR_PARTIAL returned and pcre version < 8.0? If so means I > > don't have to do a version check, just a "how many elements in > > reteruend offsets vector" check. > > Sounds like that might work ok. As it happens easy to get PCRE version number in approrpiate place in code, so I'll go that route. > Concerning the offsets option, I think it would be handy at times to be able > to request the vector be populated with both the starting and ending offset, > similar to what PCRE provides. Currently we have the option "offsets", but it > populates only one element in hVec (starting offset) - which by itself is > useless without the ending offset or the length of the string. What would you > think of adding a new option, such as "both_offsets"? Sure, not a problem. No equivalent single-letter option? I notice upper-case B appears to be vacant. And I've now remembered what to do to my option tables to get a single-letter option to work right. I think. Together with "nosubstrings" the vector would be similar to PCRE's (but I guess 1-based instead of zero-based, consistent with existing "offsets" option). With "nosubstrings" and "nocaptures" it would have two elements instead of one. Shouldn't be a problem.
