RegExp evaluators

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

RegExp evaluators

Post by Hroudtwolf »

Hello,

I have a little wish for a further PB version again.
RegExp evaluator functions like in PHP.

A replace- and a check-function would be very cool.

Maybe in such a nomenclature.

Code: Select all

regexreplace ("15. April 2003" , "/(\d+)\. (\w+) (\d+)/i" , "${2}1,$3")
findatpos = isregex ("abcdef" , "/^def/" , StartPos, EndPos")
Best regards

Wolf
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Yea I think this has been requested numerous times. I would like it too
SCRJ
User
User
Posts: 93
Joined: Sun Jan 15, 2006 1:36 pm

Post by SCRJ »

Yes, nice idea! :wink:
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post by dell_jockey »

cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
WishMaster
Enthusiast
Enthusiast
Posts: 277
Joined: Fri Jun 17, 2005 7:13 pm
Location: Franconia
Contact:

Post by WishMaster »

On Linux you can do this easily via

Code: Select all

Procedure RegAus(String.s, String2.s)
  If fnmatch_(@String, @String2, 0) = 0
    ProcedureReturn 1
  EndIf
EndProcedure

Debug RegAus("M??er", "Mayer")
Debug RegAus("M??er", "Mayer")
Debug RegAus("M??er", "Müller")
Image Image
Bonne_den_kule
Addict
Addict
Posts: 841
Joined: Mon Jun 07, 2004 7:10 pm

Post by Bonne_den_kule »

A regexp lib would be very nice.
Chrono Syndrome
Enthusiast
Enthusiast
Posts: 169
Joined: Thu Oct 05, 2006 6:44 am
Contact:

Post by Chrono Syndrome »

Good idea.
Don't try to catch ze Night !
Remember: 'z' is better zen 'th' =) !
Sorry for bad english.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

yes i agree, a must have !

fortunately there are many solutions to do so...
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
naw
Enthusiast
Enthusiast
Posts: 573
Joined: Fri Apr 25, 2003 4:57 pm

Post by naw »

Me too - this is a regular request of mine ;-) please implement Unix style RegExp (as per awk/sed) - soooo powerful (a bit cryptic but worth learning)
Ta - N
JCV
Enthusiast
Enthusiast
Posts: 580
Joined: Fri Jun 30, 2006 4:30 pm
Location: Philippines

Post by JCV »

yes pls. :)

[Registered PB User since 2006]
[PureBasic 6.20][SpiderBasic 2.2]
[RP4 x64][Win 11 x64][Ubuntu x64]
SCRJ
User
User
Posts: 93
Joined: Sun Jan 15, 2006 1:36 pm

Post by SCRJ »

Would be nice :D
Post Reply