Hi Vangelis, > ...to begin with either "b0" or "p0". > > New radio PIDs like "w3csv1y9" or "w3csvnyc", beginning with "w3", ... > [bp]0[a-z0-9]{6} > with > [bpw][a-z0-9]{7}
Other approaches, getting gradually more specific. ^[bpw][03][a-z0-9]{6}$ But this allows b3. ^(b0|p0|w3)[a-z0-9]{6}$ This is precise, but it's common to factor out alternations since each is tried in turn, so... ^([bp]0|w3)[a-z0-9]{6}$ This is as precise. The remaining problem is the `()' "capture" what matches for retrieval by the program afterwards as $1, $2, ... By introducing another set of `()' we'd have affected the position of any that come afterwards in the same regexp. (None in this case.) It's also inefficient to capture when it's unnecessary. `()' can be marked as non-capturing with `?:'. ^(?:[bp]0|w3)[a-z0-9]{6}$ These regexps aren't specific to Perl, BTW, but are useful with egrep, awk, Python, etc. -- Cheers, Ralph. https://plus.google.com/+RalphCorderoy _______________________________________________ get_iplayer mailing list get_iplayer@lists.infradead.org http://lists.infradead.org/mailman/listinfo/get_iplayer