Problem with Harbour Core ( RegEx)

Problem with Harbour Core ( RegEx)

Postby Silvio.Falconi » Thu Dec 14, 2017 3: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with Harbour Core ( RegEx)

Postby nageswaragunupudi » Thu Dec 14, 2017 5:39 pm

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Problem with Harbour Core ( RegEx)

Postby Silvio.Falconi » 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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with Harbour Core ( RegEx)

Postby Silvio.Falconi » Tue Dec 19, 2017 5:53 pm

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 ????????
Last edited by Silvio.Falconi on Tue Dec 19, 2017 6:24 pm, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with Harbour Core ( RegEx)

Postby Enrico Maria Giordano » Tue Dec 19, 2017 6:15 pm

There is no HB_REGEXHAS() function in xHarbour.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with Harbour Core ( RegEx)

Postby Silvio.Falconi » Tue Dec 19, 2017 6: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm


Re: Problem with Harbour Core ( RegEx)

Postby Antonio Linares » Wed Dec 20, 2017 11:32 am

Try removing "\" from "\Silvio\b"
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Problem with Harbour Core ( RegEx)

Postby Silvio.Falconi » Wed Dec 20, 2017 8: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 110 guests