FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with Harbour Core ( RegEx)
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Problem with Harbour Core ( RegEx)
Posted: Thu Dec 14, 2017 03:05 PM
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)
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem with Harbour Core ( RegEx)
Posted: Thu Dec 14, 2017 05:39 PM

I am getting TRUE, FALSE, TRUE
Harbour 3.2.0dev (r1703231115)

Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with Harbour Core ( RegEx)
Posted: Fri Dec 15, 2017 11:05 AM

probable you have PCRE with Borland 7 ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with Harbour Core ( RegEx)
Posted: Tue Dec 19, 2017 05:53 PM
please try this test
Code (fw): Select all Collapse
#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 (fw): Select all Collapse
[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







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)




and then i compile



the exe give me these another values

true
Ciao Max
4



why ????????
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with Harbour Core ( RegEx)
Posted: Tue Dec 19, 2017 06:15 PM

There is no HB_REGEXHAS() function in xHarbour.

EMG

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with Harbour Core ( RegEx)
Posted: Tue Dec 19, 2017 06:20 PM
Enrico Maria Giordano wrote:There is no HB_REGEXHAS() function in xHarbour.

EMG



Enrico I'm using HARBOUR !!!!!

WHERE YOU SAW XHARBOUR ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with Harbour Core ( RegEx)
Posted: Tue Dec 19, 2017 06:51 PM

Sorry, I don't use Harbour.

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problem with Harbour Core ( RegEx)
Posted: Wed Dec 20, 2017 11:32 AM

Try removing "\" from "\Silvio\b"

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with Harbour Core ( RegEx)
Posted: Wed Dec 20, 2017 08:43 PM

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 ...

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion