Filtering Table Names - how to regex with negative search?

[expired user #11683]'s profile image [expired user #11683] posted 6 years ago in General Permalink

Hi All,

Filter does not work:

^(?!prefix).*

What am I doing wrong?

Thanks, Anton

[expired user #1502]'s profile image [expired user #1502] posted 6 years ago Permalink

Looks like Heidi is not supporting such kind of regular expressions. Even (?:a) gives an error.

[expired user #11683]'s profile image [expired user #11683] posted 6 years ago Permalink

www.heidisql .com/forum.php?t=24518

In this thread they write that it works.

But I also have an example from this topic "[^ 0-9]" also does not work.

BubikolRamios's profile image BubikolRamios posted 6 years ago Permalink

AFAIK negative look ahead and behind is not something that is done for pascal. There is no library for that.

In fact it presumably is https://www.regular-expressions.info/delphi.html but no success implementing it in lazarus ...

[expired user #1502]'s profile image [expired user #1502] posted 6 years ago Permalink

www.heidisql .com/forum.php?t=24518 In this thread they write that it works.

Nope Negating character class [^ab]c = any character other than 'a' and 'b' followed by 'c'. find 'cc', but NOT 'ac' or 'bc' is not the same as Lookahead negative assertions (?!ab)c = find 'c' only if is is not preceded by 'ab' string. find 'ccc', 'aac', 'bbc', 'bac', but NOT 'abc'

[^ab]c is works fine in Heidi. I entered ^[^a] in Table filter and Heidi hides tables started from 'a' character.

ansgar's profile image ansgar posted 6 years ago Permalink

HeidiSQL uses SynRegExpr from SynEdit, which again is based on TRegExpr, so the documentation on regexpstudio.com is the right place to look after that.

That library is also at GitHub, where we could file an issue report for that missing look ahead support.

Please login to leave a reply, or register at first.