Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zregexparse



On Mar 31,  8:58am, Sebastian Gniazdowski wrote:
} Subject: Re: zregexparse
}
} PS. I've examined if zregexparse could be use to fill
} region_highlight, and it seems it can't:
} 
} zregexparse p1 p2 abc \( '/bc|?/' '{print "$p1, $p2, $mbegin[1], $mend[1], $match[1]"}' \) \#
} 1, 1, 1, 1, a
} 3, 3, 1, 2, bc

The return values from zregexparse are pretty strongly tailored to be
used with compset and compadd, and it does nothing useful with $match
and friends -- it's not tied into glob pattern referencing at all.

The values stored in $p1 and $p2 here are intended to calculate offsets
into "abc" for a call to compset -p, which isn't going to help you with
ranges for highlighting.  Also (though not significant in this eample),
zregexparse expects words joined with $'\0'.



Messages sorted by: Reverse Date, Date, Thread, Author