open knowledge community

Learn how to stop worrying about and start loving /\b([A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4})\b/gi

We will do a OpenToko (workshop) about regular expressions. The workshop will be given by Peter Uithoven who masters this super useful and timesaving technique for searching and replacing text. It will be hosted in De War, probably in the office meeting room. The date is the 11th of march.

Regular Expressions provide a concise and flexible means for searching (and replacing) text. It’s basically a very compact language to describes what you are searching for. You can use it for example to find or check e-mail addresses or links, automatically add lightbox or captions to images or for scraping websites. It let’s you do a lot of mundane things you normally would need to do by hand. You can use it in most programming languages and in a lot of text editors.

An example, the following script will give you all the alt tags from img tags in html, what ever is added inside the img element.
<img.*?alt=["'](.*?)["'].*?>
Or if you replace ^\* (.*) with <li>$1</li> you can create html out of lists like:
* item 1
* item 2

The plan is to give an introduction, give some nice references and tools and then freak with some practical challenges (you can provide).

Even if you’ve never used regular expressions, this workshop will teach you all you need for most purposes.

No Response

 

tags

 
© opentoko.org Proudly Powered by WordPress. Theme Untitled I Designed by Ruby Entries (RSS) and Comments (RSS).