Page 1 of 1

Problem with Harbour Core ( RegEx)

PostPosted: Thu Dec 14, 2017 3:05 pm
by Silvio.Falconi
if I try
? HB_RegExHas( "a", "aaa" )
? HB_RegExHas( "a", "AAA" )
? HB_RegExHas( "a", "AAA", .F. )

give me allways FALSE

instead the values must be true false true

i saw it on a guide oh harbour / core

why there is this error ?????

with Embarcadero is different ?

I have this compiler version : Compiler version: Harbour 3.2.0dev (r1703231115)

Re: Problem with Harbour Core ( RegEx)

PostPosted: Thu Dec 14, 2017 5:39 pm
by nageswaragunupudi
I am getting TRUE, FALSE, TRUE
Harbour 3.2.0dev (r1703231115)

Re: Problem with Harbour Core ( RegEx)

PostPosted: Fri Dec 15, 2017 11:05 am
by Silvio.Falconi
probable you have PCRE with Borland 7 ?

Re: Problem with Harbour Core ( RegEx)

PostPosted: Tue Dec 19, 2017 5:53 pm
by Silvio.Falconi
please try this test
Code: Select all  Expand view

#include <fivewin.ch>
#include <fileio.ch>


proc main()

   ? HB_REGEXHAS("\Silvio\b","Ciao Silvio")
   ? hb_regexReplace("\Silvio\b","Ciao Silvio","Max")
   ? len(HB_RegexAll("\b[a-z_][a-z0-9_]*\b","Ciao Silvio e Max",.F.,,,,.T.))

   return nil




if i use hbpcre.lib linked with all libs fron harbour\lib the exe give me these values ( see the picture)

false
Ciao Silvio
0


I use xmate and I have this env to compile the exe
you can see that hbpcre.lib is on this list


%HB_LIB_INSTALL%\hbpcre.lib=25


My env
Code: Select all  Expand view

[Environment]
Description 1=For Borland 7
Description 2=HARBOUR
Description 3=
PRG Compiler ver=Harbour
C compiler ver=Bcc7
Subsystem=FWH0217
Author=Falconi Silvio
Last update=04/23/2017

[Advanced]
Command types=1,1,1,1,1,1,1,1,1

[Harbour]
HB_INSTALL=C:\work\HARBOUR
HB_COMMAND=%HB_BIN_INSTALL%\Harbour.Exe %PRG% /m /n0 /gc1 /es2 /a /i%HB_INC_INSTALL% /j%HOME%\I18n\Main.hil /iinclude;c:\work\fwh\include;%HB_INSTALL%\include
Option prefix=/

[C]
C_INSTALL=C:\work\bcc7
C_COMP_COMMAND=%C_BIN_INSTALL%\Bcc32.Exe -M -c %CRLF%-DHB_OS_WIN_32 %CRLF%-DHB_FM_STATISTICS_OFF %CRLF%-DHB_NO_DEFAULT_API_MACROS %CRLF%-DHB_NO_DEFAULT_STACK_MACROS %CRLF%-I%C_INC_INSTALL%\windows\sdk\;%HB_INC_INSTALL%  -n%HOME%\Obj %C%%CRLF%%CRLF%%CRLF%
C_LIB_COMMAND=%C_BIN_INSTALL%\TLib.Exe %LIB% /P512 @%RSP% , %LST%
C_LINK_COMMAND=%C_BIN_INSTALL%\iLink32.Exe -Gn -aa -Tpe -s -v @%LNK%
C_RC_COMMAND=c:\work\PellesC\Bin\PORC.EXE  %RC%  /I c:\work\pellesc\include /I c:\work\pellesc\include\win
C_DLL_COMMAND=%C_BIN_INSTALL%\iLink32.Exe -Gn -aa -Tpd -M -L%C_LIB_INSTALL% @%LNK%
Option prefix=-

[User]
POSTEXE_COMMAND=
POSTLIB_COMMAND=
POSTDLL_COMMAND=

[Files]
%C_LIB_INSTALL%\C0W32.OBJ=1
%C_LIB_INSTALL%\CW32.LIB=2
C:\Work\FWH\lib\Fiveh.lib=3
C:\Work\FWH\lib\Fivehc.lib=4
%HB_LIB_INSTALL%\hbrtl.lib=5
%HB_LIB_INSTALL%\hbvm.lib=6
%HB_LIB_INSTALL%\hbgt.lib=7
%HB_LIB_INSTALL%\gtgui.lib=8
%HB_LIB_INSTALL%\hblang.lib=9
%HB_LIB_INSTALL%\hbmacro.lib=10
%HB_LIB_INSTALL%\hbcommon.lib=11
%HB_LIB_INSTALL%\hbpp.lib=12
%HB_LIB_INSTALL%\hbrdd.lib=13
%HB_LIB_INSTALL%\rddntx.lib=14
%HB_LIB_INSTALL%\rddcdx.lib=15
%HB_LIB_INSTALL%\rddfpt.lib=16
%HB_LIB_INSTALL%\hbwin.lib=17
%HB_LIB_INSTALL%\hbsix.lib=18
%HB_LIB_INSTALL%\hbziparc.lib=19
%HB_LIB_INSTALL%\hbcpage.lib=20
%HB_LIB_INSTALL%\hbcplr.lib=21
%HB_LIB_INSTALL%\hbmzip.lib=22
%HB_LIB_INSTALL%\minizip.lib=23
%HB_LIB_INSTALL%\xhb.lib=24
%HB_LIB_INSTALL%\hbpcre.lib=25
%HB_LIB_INSTALL%\hbct.lib=26
%HB_LIB_INSTALL%\hbzlib.lib=27
%C_LIB_INSTALL%\uuid.lib=28
%C_LIB_INSTALL%\IMPORT32.LIB=29
%C_LIB_INSTALL%\PSDK\odbc32.lib=30
%C_LIB_INSTALL%\PSDK\nddeapi.lib=31
%C_LIB_INSTALL%\PSDK\iphlpapi.lib=32
%C_LIB_INSTALL%\PSDK\msimg32.lib=33
%C_LIB_INSTALL%\PSDK\ws2_32.lib=34
%C_LIB_INSTALL%\PSDK\psapi.lib=35
%C_LIB_INSTALL%\PSDK\rasapi32.lib=36
%HB_LIB_INSTALL%\png.lib=37
%C_LIB_INSTALL%\PSDK\shell32.lib=38

[DLL Files]
%HB_LIB_INSTALL%\harbour.lib=1
%C_LIB_INSTALL%\C0W32.OBJ=2
%C_LIB_INSTALL%\CW32.LIB=3
%C_LIB_INSTALL%\IMPORT32.LIB=4
 




Image


if i use hbpcre.lib linked with all libs fron harbour\lib as sad on top and another more lib (the same) from folder of exe ( see the picture)

Image


and then i compile

Image

the exe give me these another values

true
Ciao Max
4



why ????????

Re: Problem with Harbour Core ( RegEx)

PostPosted: Tue Dec 19, 2017 6:15 pm
by Enrico Maria Giordano
There is no HB_REGEXHAS() function in xHarbour.

EMG

Re: Problem with Harbour Core ( RegEx)

PostPosted: Tue Dec 19, 2017 6:20 pm
by Silvio.Falconi
Enrico Maria Giordano wrote:There is no HB_REGEXHAS() function in xHarbour.

EMG



Enrico I'm using HARBOUR !!!!!

WHERE YOU SAW XHARBOUR ?

Re: Problem with Harbour Core ( RegEx)

PostPosted: Tue Dec 19, 2017 6:51 pm
by Enrico Maria Giordano
Sorry, I don't use Harbour.

EMG

Re: Problem with Harbour Core ( RegEx)

PostPosted: Wed Dec 20, 2017 11:32 am
by Antonio Linares
Try removing "\" from "\Silvio\b"

Re: Problem with Harbour Core ( RegEx)

PostPosted: Wed Dec 20, 2017 8:43 pm
by Silvio.Falconi
I do not think it's correct item,

in regex \S it does not mean anything,

it should be interpreted as S, I wanted to \bS where \b means "word limiter" practically the regex "Silvio"

also finds Silvio inside the word "faSilvioooo"

(at random) while the regex ""\bSilvio\b" finds only Silvio if it is a unique word.

and However if this were the problem the 3rd case, which is correctly written, would work ...

I think the problem is that in harbor the libraries are looked for when compiling the compiler not in the process of compiling the single program ...