Re: C# programmer wants to learn assembly?? plz help
- From: "Dragontamer" <prtiglao@xxxxxxxxx>
- Date: 30 Dec 2006 22:09:03 -0800
David Jones wrote:
Dragontamer <prtiglao@xxxxxxxxx> wrote...
David Jones wrote:
[snip code]ECMAscript?? Ewww... Go Perl :-)
Yeah, Perl would be a better example, but IIRC the regex syntax is
different, and I only know ECMAScript regex syntax.
All regex is based on grep somewhat. They are all very similar.
Though... if ECMAscript has grouping and all that, they must
be virtually identical.
I have no clue about ECMA, but I'm almost certain that Perl can
make any challenge you throw at it. Especially with its massive
library.
Perl + ImageMagick API and ~50 lines of code can do things that
whole applications cannot do to pictures without significant
effort/plugins for example.
if(string =~ m/\(?\d{3}\)?\s*\d{3}(-|.)?\d{4}/ )
There, and no nasty || statements making the example
excessivly long.
The reason for the || is to break it up so that you don't have lots of |
in the expression. Your version wouldn't work since it would also
match:
(202 555.1212
And doesn't match:
202/555-1212
Toche. For the latter example, I shall do d{3}[\)\/]? and that fixes
it :-)
For the earlier example, meh, I give up. Use your stupid ||
statements. :-p
Took about 1 minute but no test yet; cause I suck with Perl
and don't feel like compile-checking :-p
Does ECMAscript have grouping? In Perl you can just
do \d{3}(-|.)?\d{3} and that will match each of the following:
Yes, I used it in the other example.... :)
You did? Where? :-p
--Dragontamer
.
- Follow-Ups:
- Re: C# programmer wants to learn assembly?? plz help
- From: David Jones
- Re: C# programmer wants to learn assembly?? plz help
- References:
- C# programmer wants to learn assembly?? plz help
- From: giddy
- Re: C# programmer wants to learn assembly?? plz help
- From: Frank Kotler
- Re: C# programmer wants to learn assembly?? plz help
- From: //\\\\o//\\\\annabee
- Re: C# programmer wants to learn assembly?? plz help
- From: Herbert Kleebauer
- Re: C# programmer wants to learn assembly?? plz help
- From: Betov
- Re: C# programmer wants to learn assembly?? plz help
- From: Herbert Kleebauer
- Re: C# programmer wants to learn assembly?? plz help
- From: Betov
- Re: C# programmer wants to learn assembly?? plz help
- From: Herbert Kleebauer
- Re: C# programmer wants to learn assembly?? plz help
- From: David Jones
- Re: C# programmer wants to learn assembly?? plz help
- From: David Jones
- Re: C# programmer wants to learn assembly?? plz help
- From: David Jones
- Re: C# programmer wants to learn assembly?? plz help
- From: Dragontamer
- Re: C# programmer wants to learn assembly?? plz help
- From: David Jones
- C# programmer wants to learn assembly?? plz help
- Prev by Date: Re: C# programmer wants to learn assembly?? plz help
- Next by Date: Re: C# programmer wants to learn assembly?? plz help
- Previous by thread: Re: C# programmer wants to learn assembly?? plz help
- Next by thread: Re: C# programmer wants to learn assembly?? plz help
- Index(es):
Relevant Pages
|