Page 1 of 1

Version of PCRE that PureBasic uses?

Posted: Thu Jul 17, 2025 10:42 pm
by BarryG
I'm using PureBasic v6.10 but can't find a way to determine which version of PCRE it uses for its Regular Expression library? I need to know because a customer has asked so they can use the correct syntax for one of their regex text. Thanks!

Re: Version of PCRE that PureBasic uses?

Posted: Fri Jul 18, 2025 5:05 am
by IceSoft

Code: Select all

ImportC ""
pcre_version(void);
EndImport

regex = CreateRegularExpression(#PB_Any, "")
pcre_version = pcre_version(0)
Debug PeekS(pcre_version)
Sorry seems no longer working.

Re: Version of PCRE that PureBasic uses?

Posted: Fri Jul 18, 2025 6:04 am
by idle
this Pb_ I had looked at it earlier thinking it was a variable rather than a function

Code: Select all

ImportC ""
 pb_pcre_version(void);
EndImport

regex = CreateRegularExpression(#PB_Any, "")
pcre_version = pb_pcre_version(0)
Debug PeekS(pcre_version,-1,#PB_Ascii)

Re: Version of PCRE that PureBasic uses?

Posted: Fri Jul 18, 2025 9:12 am
by Shardik
idle's example was already posted by Fred about 9 years ago... :wink:

Re: Version of PCRE that PureBasic uses?

Posted: Fri Jul 18, 2025 9:23 am
by Little John
Shardik wrote: Fri Jul 18, 2025 9:12 am idle's example was already posted by Fred about 9 years ago... :wink:
Maybe it would be a good idea to include that snippet in the help.

Re: Version of PCRE that PureBasic uses?

Posted: Fri Jul 18, 2025 10:02 am
by idle
Maybe it would be a good idea to have all libs with a version function for cases like this.

Re: Version of PCRE that PureBasic uses?

Posted: Fri Jul 18, 2025 10:11 am
by Little John
idle wrote: Fri Jul 18, 2025 10:02 am Maybe it would be a good idea to have all libs with a version function for cases like this.
:thumbsup:

Re: Version of PCRE that PureBasic uses?

Posted: Fri Jul 18, 2025 10:29 am
by IceSoft
Ah yes "PB_" is needed too:
Here the correct version (void is 'empty"):

Code: Select all

ImportC ""
 pb_pcre_version();
EndImport

regex = CreateRegularExpression(#PB_Any, "")
pcre_version = pb_pcre_version()
Debug PeekS(pcre_version,-1,#PB_Ascii)

Re: Version of PCRE that PureBasic uses?

Posted: Fri Jul 18, 2025 1:38 pm
by BarryG
Thanks, everyone. :)

Re: Version of PCRE that PureBasic uses?

Posted: Tue Jul 22, 2025 2:35 pm
by Piero
Wow; it's older than I thought, but at least it seems to support \K :wink:

Can't quickly find now, but there's a (10?) numbered groups support implementation in this forum (named groups are already available in PB)

Probably it's an AZJIO thing… Thanks!

PS/Edit:
It's this: viewtopic.php?p=643353#p643353