?

Log in

No account? Create an account

[icon] Regular Expressions - Blue Swiss Cheese ( 브루 쉬쓰 치즈)
View:Recent Entries.
View:Archive.
View:Friends.
View:Profile.
View:Website (The Blues side of the Moon).
View:Memories. Projects. Freshmeat.

Security:
Subject:Regular Expressions
Time:02:24 am
New post on beginning regular expressions on my tech blog. It's really aimed at people who've never done regular expressions ever before, so if you have, you'll be bored. I still welcome feedback though.

Oh yeah, try highlighting some text in that post and see what happens.
comments: Leave a comment Previous Entry Share Next Entry


tariquesani
Link:(Link)
Time:2006-04-29 05:59 am (UTC)
Oh yeah, try highlighting some text in that post and see what happens.
Cool effect - but the postion at which the Y! icon is popping up is about 100px too far for me - FF 1.5
(Reply) (Thread)


bluesmoon
Link:(Link)
Time:2006-04-29 06:16 am (UTC)
same for me - will have to tell the Y!Q team about it.
(Reply) (Parent) (Thread)


fus
Link:(Link)
Time:2006-04-29 09:40 am (UTC)
language specific
unlike that wonderful tome
(Reply) (Thread)


bluesmoon
Link:(Link)
Time:2006-04-29 03:32 pm (UTC)
no it's not. where do you see language specifics? Just because I've used =~ as a notation, does not mean it's perl. It's merely a notation I will use in my tutorial to indicate matching.
(Reply) (Parent) (Thread)


code_martial
Link:(Link)
Time:2006-04-30 04:10 am (UTC)
I don't know Perl and to me it appeared completely language independent.
(Reply) (Parent) (Thread)


lawgon
Link:(Link)
Time:2006-04-29 12:30 pm (UTC)
/me volunteers to translate this into python - when a few more lessons are up
(Reply) (Thread)


bluesmoon
Link:(Link)
Time:2006-04-29 03:32 pm (UTC)
I don't want language specific tutorials. I specifically want this to be language independent.
(Reply) (Parent) (Thread)


lawgon
Link:(Link)
Time:2006-04-29 03:39 pm (UTC)
then why did you do it with perl syntax?
(Reply) (Parent) (Thread)


bluesmoon
Link:(Link)
Time:2006-04-29 03:44 pm (UTC)
did you actually read the tutorial or did you just jump to conclusions when you saw something you didn't like?

regular expressions are a language of their own. they have their own grammar and symbols. other languages merely embed them using their choice of delimiters and operators. I've chosen delimiters that would cause the least interference and confusion.

Choosing double quotes as delimiters would have caused confusion between strings and regexes, and also forced me to escape double quotes in patterns. Not using delimiters would have made it hard for me to include leading or trailing spaces. Using parentheses as delimiters would have forced me to escape grouping parens within a pattern. The / character makes for a good delimiter, because except for unix directory paths and urls, one doesn't really use the / too much. I will also stay away from the / in most of my examples, introducing it only when I need to talk about escaping.
(Reply) (Parent) (Thread)


lawgon
Link:(Link)
Time:2006-04-29 03:54 pm (UTC)
sorry '=~' is unique to perl
(Reply) (Parent) (Thread)


bluesmoon
Link:(Link)
Time:2006-04-29 03:58 pm (UTC)
again, I chose =~ so as not to confuse it with the assignment operator = or the equality operator ==, both of which are common to most languages. I could have chosen just ~, but that seems to signify almost equal to.
(Reply) (Parent) (Thread)


trycatchdenz
Link:(Link)
Time:2006-04-30 06:08 pm (UTC)
I will keep a tab on this. Thanks for the posts.

Cheerz,
Denz
(Reply) (Thread)

[icon] Regular Expressions - Blue Swiss Cheese ( 브루 쉬쓰 치즈)
View:Recent Entries.
View:Archive.
View:Friends.
View:Profile.
View:Website (The Blues side of the Moon).
View:Memories. Projects. Freshmeat.