Crosstips.org

My fun Crossword solver project. Crosstips.org & Krysstips.se

Kung Fu

Fujian White Crane Kung Fu

Fry-IT

Fry-IT is the company I work for

Photos

Photoalbum, both old and new.

Zope

What I have and am doing with Zope

Receptsamlingen

In Swedish only. About my "Collection of Recipes" website.

Contact me

My contact details and how to contact me.

 

KungFuPeople.com
Do you train Kung Fu?
Or know someone who does?
Then check out KungFuPeople.com


Mobile version of this page Mobile version of this page


 

You searched for keyword:regular expressions
 

found 0 photos and 8 blogs in and 0 blog comments in 0.00 seconds



 

Blogs

  Anti-spamming email harvesting - 26th of February 2004

Stu's Site has a nice example of a way of preventing email harvesting by writing the email in reverse and then letting stylesheets reverse it when rendering. The HTML source looks like this:

 <style type="text/css">
 .backwards {unicode-bidi:bidi-override; direction: rtl;}
 </style>
 <span class="backwards">ku.oc.u7s@uts</span>

  Regular Expressions in Javascript cheat sheet - 18th of June 2005

This is just so cool. It's a preview of VisiBone's printable cheat sheet of Javascript regular expressions. I really like the idea and will return here many times probably.

  \b in Python regular expressions - 14th of June 2005

Boy did that shut me up! The \b special character i python regular expressions is so useful. I've used it before but have forgotten about it. The following code:

 def createStandaloneWordRegex(word):
    """ return a regular expression that can find 'peter'
    only if it's written alone (next to space, start of 
    string, end of string, comma, etc) but not if inside 
    another word like peterbe """

    return re.compile(r"""
      (
      ^ %s
      (?=\W | $)
      |
      (?<=\W)
      %s
      (?=\W | $)
      )
      """
% (re.escape(word), re.escape(word)),
            re.I|re.L|re.M|re.X)

  \B in Python regular expressions - 23rd of July 2005

Today I learnt about how to use the \B gadget in Python regular expressions. I've previously talked about the usefulness of \b but there's a big benefit to using \B sometimes too.

  Python regular expression tester - 19th of September 2005

I've just discovered retest by Christof Hoeke which is a developers tool for testing and experimenting with regular expressions. It doesn't have a GUI so it uses SimpleHTTPServer to serve a web interface on http://localhost:8087 that uses AJAX to make the interface snappier. You use this if you feel uncertain how to write your regular expression syntax and need a helpful sandbox for playing in.