Re: [PBML] Numerical or String
- Hello Shawn,
I appreciate you help. Thanks a lot.
Shawn Milochik <shawn@...> wrote:
On Oct 10, 2006, at 10:33 AM, Marcos Onisto wrote:
> I confess that regexp is yet dificult to me.
> Thanks a lot,
> Marcos Luiz Onisto
I highly recommend "Mastering Regular Expressions" by Jeffrey Friedl.
In my opinion, it's the easiest (and most fun) way to learn regular
expressions. The third edition was just released. I read the second
edition, and it's great.
Don't be scared off by things like this: /^\d+$/
Just to show you how easy this can be, read along with me.
^ (means the beginning of a line)
\d (means digits, 0 through 9)
+ (means one or more of whatever it comes after, in this case, digits)
$ (means "end of line")
So all /^\d+$/ means is "Match if the line contains one or more
digits, and nothing else."
Or, more literally, "Match the beginning of the line, followed by one
or more digits, followed by the end of the line."
It will not match input if there is a newline character or there are
blank spaces in the variable. You'd have to tweak the regex to do that.
Hope this helps.
All-new Yahoo! Mail - Fire up a more powerful email and get things done faster.
[Non-text portions of this message have been removed]