Open peace2000 opened 1 year ago
Hello, I don't think this is possible, but we can try. I'm using "advanced-mark.js" library that's doing all the searching, so if it supports it, I may be able to add support for that. See his playground here: https://angezid.github.io/advanced-mark.js/playground/ Make sure to switch to "RegExp" tab and then write your regexp, write some testing string below that and hit "Run". I couldn't make it work for multi-line though.
Please, is there an alternative way to highlight only if the word is at the beginning of the string? For example, what I would normally do:
Regex: ^aaa
bbb
aaa (this "aaa" gets highlighted)
bbb aaa (this "aaa" doesn't get highlighted)
I think you are looking for word boundary, see also: https://stackoverflow.com/questions/1324676/what-is-a-word-boundary-in-regex
For example I use this one to highlight "S01":
\Ws\d{2}\W
I think you are looking for word boundary, see also: https://stackoverflow.com/questions/1324676/what-is-a-word-boundary-in-regex
For example I use this one to highlight "S01":
\Ws\d{2}\W
Thanks. I got it working using non-capturing groups to identify the line break.
Hi, would be it possible to add support for matching multiple lines in RegExp? It doesn't seem to be possible to match for multiple lines currently.
This would probably need an option
g
in RegExp, but as AH doesn't require/
and/
to make the rule RegExp, I could not figure out a way how to do multiple line matching.With
g
option https://regex101.com/r/l0S8TQ/1 Withoutg
option (the current behavior in AH): https://regex101.com/r/95yoNH/1