background preloader

Regexp

Facebook Twitter

Txt2re: headache relief for programmers. Applied regular expressions in PHP: Provisioning the Linksys PAP2T. Linksys is helpful in giving the overall approach to provisioning these units.

Applied regular expressions in PHP: Provisioning the Linksys PAP2T

The process consists of creating a special XML file that sits on a server, and instructing the unit to provision itself from that location. The XML file specifies the parameters that control the unit's operation, and their values. It sounds simple, but there are a couple of hurdles to be cleared. First, the parameter names need to be retrieved from the unit, and secondly there are more than 500 of them, so the process could be very tedious. Learning to Use Regular Expressions. Often if you find that your regular expressions are matching too much, a useful procedure is to reformulate the problem in your mind.

Learning to Use Regular Expressions

Rather than thinking about "what am I trying to match later in the expression? " ask yourself "what do I need to avoid matching in the next part? " Often this leads to more parsimonious pattern matches. Often the way to avoid a pattern is to use the complement operator and a character class.