Open talwrii opened 1 year ago
Having a look at the code, this line seems to be the problem. Stuff is added to the beginning of the regexp so that "^" is no longer at the beginning.
https://github.com/alphapapa/org-ql/blob/4c1a4b169f54d37ce541902c0ae5043759ef9d9b/org-ql.el#L1490
Hello,
Thanks for pointing this out. Yes, it appears that the regexp optimization for this predicate interferes with these regexp metacharacters. Ideally they should work "naturally," according to the user's expectations, but they currently don't.
This can probably fixed, but it will require careful design and testing, and maybe also documentation of any limitations that remain.
In the meantime, if you require this functionality, you can disable the use of regexp "preambles" by binding org-ql-use-preamble
to nil around your search code, which will allow the regexp to be tested only by the predicate's body form: https://github.com/alphapapa/org-ql/blob/4c1a4b169f54d37ce541902c0ae5043759ef9d9b/org-ql.el#L1502-L1504
Ah awesome! That seems like a useful workaround. This was already a bit of a hack to search relative to the current a given node (often the current one). As I've looked at the code a little it doesn't seem like it would be that difficult implement this as a predicate so I might have a go doing that.
This is call gives me results
as does this
and this
but all of the following give me no results: