Page 1 of 2
[Implemented] RegExp
Posted: Mon Oct 04, 2004 2:14 pm
by blueznl
see here...
viewtopic.php?p=70899#70899
regular expressions to use on strings would be nice...
Posted: Mon Oct 04, 2004 2:40 pm
by Dare2
Yes.
Posted: Mon Oct 04, 2004 3:34 pm
by PolyVector
could somebody please explain to me what RegExp is?
I've heard some talk about it lately and to be honest I'm feelin' a bit out of the loop

Posted: Mon Oct 04, 2004 4:46 pm
by blueznl
know a little dos?
it's like using wildcards, patterns and the like, only more flexible aka. more complex

Posted: Mon Oct 04, 2004 4:56 pm
by PolyVector
Ohhh... got it

I coded one of those for Rapid-Q a while back... I wonder if I still have it!

Posted: Mon Oct 04, 2004 5:01 pm
by Kale
PolyVector wrote:could somebody please explain to me what RegExp is?

I've heard some talk about it lately and to be honest I'm feelin' a bit out of the loop

http://etext.lib.virginia.edu/helpsheets/regex.html
Regular Expresions are extremely useful for checking and/or replacing strings. Very quick too.
Posted: Tue Oct 05, 2004 7:08 pm
by ivory
Kale wrote:PolyVector wrote:could somebody please explain to me what RegExp is?

I've heard some talk about it lately and to be honest I'm feelin' a bit out of the loop

http://etext.lib.virginia.edu/helpsheets/regex.html
Regular Expresions are extremely useful for checking and/or replacing strings. Very quick too.
I don't know if I would call them very quick. They are adequate for working with small strings and parameter lists, but I have found them quite unsatisfactory working with large strings.
Another similar product I have used is "AWK", but still, nothing beats a well written piece of code.
Posted: Wed Oct 06, 2004 8:11 am
by Kale
I guess i meant very quick to input complicated search patterns. i.e. checking an email address is easy

Posted: Tue Nov 09, 2004 11:00 am
by techjunkie
Yeahh!!!
regexp would be so cool!!!
/<(\w+)[^>]*>[^<]*<\/\1>/ig

Posted: Wed Nov 10, 2004 5:06 pm
by prefuct
*loses his lunch*
Posted: Fri Nov 12, 2004 2:19 am
by naw
Regular Expressions are a must for a X-Platform Language (that includes Unix/Linux). Its true that ReExprs are fairly painful to learn - but believe me if you come from the Unix/Linux Scripting world and take RegExpr for granted with SED / AWK / GREP etc. Its a hard painful world without them. Seriously, 10 chars of RegExpr = 100 lines of code in any regular language.
Ok - perhaps a slight exaggeration, but those who use it know what I mean.
Such a shame that PB lacks RE & STDIN
Please Fred STDIN would take you a couple of hours to code

and you could bolt in a *standard* RE Library, I'm sure....
Posted: Sat Nov 13, 2004 8:21 pm
by blueznl
stdin / stdout yes please...
Posted: Thu Dec 09, 2004 12:09 am
by hattonpa
Yes, regular expressions please! Also, STDIN/STDOUT please!
The PBRegExpEx lib by FloHimself is a great help. But I had to work for a while to get my head around the syntax and build my own procedures to make its implementation a little easier for me. It reminds me somewhat of PCRE, which I used once in a C++ app. I'm sure part of the reason for the time it took was because I'm new to PureBasic. No global or case-insensitive functionality. But, I'm certainly glad FloHimself has provided it. I'm a regular expression junkie

Posted: Mon Dec 13, 2004 2:41 pm
by bluejoke
I would appreciate a RegExp-implication, too!
Posted: Thu Dec 16, 2004 4:41 am
by hattonpa
Just wanted to correct my previous statement that with PBRegExpEx there is 'no... case-insensitive functionality'. There is, in fact, control over case sensitivity when searching with the meta characters \u (upper case) and \l (lower case). Guess I hadn't read the Help file carefully enough. <grimace> So, while I prefer Perl's syntax of "/[a-z]+/i" I can get the results I need using PBRegExpEx with "(/u|/l)+". Of course, in this case, I'd have the possible overhead of an unneeded backreference or subexpression.
Anyway, just thought I'd clarify, in case anyone cares...
Paul H.