Preserved Topic: Regular Expressions (Page 1 of 1) |
|
---|---|
Maniac (V) Inmate From: Boston, MA, USA |
posted 09-14-2000 20:09
(I posted this on the Gurus board to, so apologies to those who read both) |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 09-14-2000 21:14
Well, my JavaScript book covers them, but I'm no expert so I'll wait for a Perl guru to come along first... |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 09-14-2000 21:15
Okay I am not a big fan of regular expressions (My bad but I need to learn more) |
Maniac (V) Inmate From: Boston, MA, USA |
posted 09-14-2000 21:25
Thanks. It didn't HAVE to be a RegEx, just couldn't think of any other way. This looks cleaner and simpler. RegEx is so tough for me to wrap my brain around, but when I get one to work it is so fast and powerful I jump up and down. |
Maniac (V) Inmate From: Boston, MA, USA |
posted 09-14-2000 21:42
Fooey. |
Maniac (V) Inmate From: Houston(ish) Texas |
posted 09-14-2000 22:01
The regular expression: |
Maniac (V) Inmate From: Boston, MA, USA |
posted 09-14-2000 22:26
Das - your eyes caught it. Sheesh. Copy and paste is a wonderful thing, but it helps to actually look at it too. |
Maniac (V) Inmate From: Houston(ish) Texas |
posted 09-14-2000 23:13
I'm a C++ programmer by trade; I'm very skilled at finding little bitty punctuation errors <img border=0 align=absmiddle src="http://www.ozones.com/forum/smile.gif"> |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 09-15-2000 00:02
Ah, glad you got it. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 09-15-2000 02:18
Actually Slime is right I think you do want to use the !=-1 or actually just < 0 |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 09-15-2000 03:32
Well, don't use "< 0" because that will return true if it *isn't* there. Either "!= -1" or ">= 0" will work. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 09-15-2000 04:18
yeah |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 09-15-2000 04:19
=D |
Maniac (V) Inmate From: Boston, MA, USA |
posted 09-15-2000 21:56
They both worked for me. I switched to the !=-1 since Slime said it's more commonly seen and who wants to be uncommon, but for the record both approaches worked well. |