Feasibility of pattern matching support for templates and/or scripts?

In my current project I could really use a built-in function for templates and/or scripts to test whether a byte sequence (beginning at a specified offset in the current file, with an optional maximum length) matches an arbitrary pattern.

If you think this might be practical to add to 010 Editor, I think it would be a very powerful feature–even if it didn’t provide all the capabilities that the more powerful regular expression engines are capable of–such as capturing and replacement.

Do the FindAll and FindFirst tool functions not already provide what you want?

010 Editor supports regular expressions and also supports wildcard matches with ‘*’ and ‘?’ for a simpler way of matching. You should be able to use FindFirst/FindAll to check if a sequence is at the beginning of a file. You can also use the RegExMatch function to check if a byte sequence matches a certain regular expression.

Graeme
SweetScape Software

I wonder how I missed those? D’oh!

I must not have scrolled all the way down to the bottom of the help on Using Regular Expressions.

The Oniguruma regex library has support for retrieving the matches for named or anonymous (numbered) capture groups. 010 Editor’s Find commands in Regex mode support these, too, and allows their use in replacement strings.

A nice enhancement to the functionality of FindAll(), would be to allow retrieval of capture groups that matched. Perhaps the struct TFindResults could be expanded to include fields for them.