Regular Expression Basics

Ciarán Walsh (22.Nov.2008 at 06:00)
Talk at PHP North West 2008 (English - US)

Rating: 4 of 5

In the right hands regular expressions can be a powerful tool, but it’s also far too easy for them to be used badly, or in the wrong situations.

This talk will kick off with a look at alternatives to regular expressions, for when the power of pattern matching is not required, and will also go over some cases when there are better alternatives available.
Then there will be a brief refresher on pattern syntax and some general tips and tricks to help when constructing regular expressions, before we go on to look at some situations where the use of pattern matching is a good fit, how to solve some common problems, and some common pitfalls when writing patterns.

Who are you?

Claim talk

By clicking this button you are declaring that you are the speaker responsible for it and a claim request will be sent to the administrator of the event.

If the claim is approved you will be able to edit the information for this talk.

Are you sure?

 
Comments closed.

Comments

Rating: 5 of 5

22.Nov.2008 at 11:36 by

It was really good, as an amateur to Regex it was good to see it explained better than any resource I have found online so far.

Rating: 4 of 5

22.Nov.2008 at 11:48 by

Learn't a little more than i knew before the talk :)

Rating: 4 of 5

22.Nov.2008 at 15:50 by

Thanks Ciaran,

Helpful talk on regex, cleared up a few issues for me.

Cheers,

Chris

Rating: 4 of 5

24.Nov.2008 at 09:24 by David Goodwin

Most of the talk was obvious to me - however I didn't know about the named placeholders - obviously $matches[1] is so much better.... *ahem*

It should perhaps have mentioned the problem with $ - in that it can contain a newline - see http://blog.php-security.org/archives/76-Holes-in-most-preg_match-filters.html

Rating: 5 of 5

24.Nov.2008 at 18:24 by Stefan Koopmanschap

Well done. One thing that really stuck to me was the way you can document your regexp by using comments, I had no idea that was possible.

Rating: 3 of 5

25.Nov.2008 at 09:01 by

Enjoyable talk, but I felt the examples should have show results of the code a little more than they did.

Rating: 3 of 5

25.Nov.2008 at 09:20 by Anthony Doherty

I know my regexp but thought I'd stick around as iteration always helps - and as GingerDog said - that named placeholder syntax was a surprise so I learned something new too.

Cloud server hosting by Combell Combell      © Joind.in 2012