On Tue, 10 Mar 2009, Lorenzo Fiorini wrote:
Hi,
> > Anyhow RegexMatch is commonly used name so maybe we should leave it and add
> > support for the 5-th parameter and by default it should be set to HAS.
> > In such version I do not have to use 5-th parameter but I can simply define
> > pattern which will have to cover whole value.
> > I vote for this. It's 2.
> In my code I use it as:
> if HB_RegexMatch( "[*?!|\/{}<>;,^()$~.'" + '"]', cParam )
> or
> bTblFor := { || HB_RegexMatch( xTables, alltrim( TBL->CTBLNAME ), TRUE ) ...
> which will be the "correct" syntax to have it working under 1.0.1 and 1.1?
In the 1-st it's the same as HB_RegexHas(), in the second version it's
the same as HB_RegexLike().
You can use these functions or you will have to change the second
HB_RegexMatch() in your code to:
HB_RegexMatch( xTables, alltrim( TBL->CTBLNAME ), /* <lCaseSensitive> */,;
/* <lNewLine> */, TRUE )
The problem is with 3-rd parameter. It's internally used to enable/disable
case sensitive comparison. It's common to all hb_regex*() functions.
And here we have problem. If you make:
HB_RegexMatch( xTables, alltrim( TBL->CTBLNAME ), FALSE )
then it will work like hb_regexHas() but it also disables case sensitive
comparison so the results can be different then expected.
Two different things are controlled by the same parameter:
fCaseSensitive = !ISLOG( 3 ) || hb_parl( 3 );
fLike = hb_parl( 3 );
For sure it has to be fixed.
best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour