New radio PIDs, more than 8 characters - "solved"

Ralph Corderoy ralph at inputplus.co.uk
Tue Aug 15 02:48:04 PDT 2017


Hi C. E.,

> it might be necessary to bracket it at the beginning and end with
> non-capturing non-word meta- or pseudo-characters

Rather than \W, representing a single non-word character, \b would be
better, meaning a zero-width boundary between a word, \w, and non-word,
\W, character, or the start or end of the string.  /\Wfoo\W/ matches
":foo:", but not "foo", but /\bfoo\b/ matches both.  The zero-width
means it consumes nothing;  the test is of the character either side.

>     pseudo code
>     if --url
>       strip characters following last /
>       use as pid
...
> ... particularly as URLs exist with other characters after the PID,
> though perhaps these might not be used in the context of GiP.

Yes, it's never that simple.  :-)  URLs have a defined structure and
encoding rules, and there's query parameters and fragments to consider.

> Pretty much the first item in that list was to declare constants at
> the beginning of the program containing all the fixed or semi-fixed
> values that the program needed

Though that can put them a long way from their use, removing context
from their definition and requiring it to be put back into their
identifier instead.

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



More information about the get_iplayer mailing list