Discussion:
Searching for programmes which start with a number
Paul Oldham
2017-11-15 20:56:43 UTC
Permalink
If you try searching for "1834", which is a BBC Radio 4 Xtra programme,
you don't get any matches for the programme (although you do on
programme number 1834). Thus:

--------------------------------------------------------------------------------
$ get_iplayer --type radio 1834
get_iplayer 3.06-ppa31a, Copyright (C) 2008-2010 Phil Lewis
This program comes with ABSOLUTELY NO WARRANTY; for details use
--warranty.
This is free software, and you are welcome to redistribute it under
certain
conditions; use --conditions for details.

Matches:
1834: tv, Points West: Evening News - 06/11/2017, BBC One, b09bzw4g
INFO: 1 matching programmes
$
--------------------------------------------------------------------------------

There are two programmes there however:

--------------------------------------------------------------------------------
$ get_iplayer --type radio | grep 1834
30028: 1834 - What Century Are You Living In?, BBC Radio 4 Extra,
b01137b8
30029: 1834 - The Time Machine, BBC Radio 4 Extra, b011db7v
31834: As BBC Radio 5 live - 02/11/2017, BBC Radio Leicester, p05jmtqt
41834: Radio 3 in Concert - Verbier Festival Orchestra, Mikhail
Pletnev. Tchaikovsky, BBC Radio 3, b09d3ndk
$
--------------------------------------------------------------------------------

This seems to be true of any programme starting with a number ("15
Minute Drama" for example, or "40 Years of The News Quiz") however it
does match on programme names which begin with a numeric but aren't
numbers ("2Tone Taxi" for example).

Do I have to do some sort of clever quoting to get around this or is it
a bug? Thanks.
--
Paul
Derek Kaye
2017-11-15 21:08:51 UTC
Permalink
Good evening Paul
Post by Paul Oldham
This seems to be true of any programme starting with a number ("15
Minute Drama" for example, or "40 Years of The News Quiz") however it
does match on programme names which begin with a numeric but aren't
numbers ("2Tone Taxi" for example).
Do I have to do some sort of clever quoting to get around this or is
it a bug? Thanks.
You can treat it as a regular expression and search for ^15 for example.
If you just use a number it will treat it as an ID.

Best regards

Derek
Paul Oldham
2017-11-15 21:26:13 UTC
Permalink
Post by Derek Kaye
Post by Paul Oldham
This seems to be true of any programme starting with a number ("15
Minute Drama" for example, or "40 Years of The News Quiz") however it
does match on programme names which begin with a numeric but aren't
numbers ("2Tone Taxi" for example).
Do I have to do some sort of clever quoting to get around this or is
it a bug? Thanks.
You can treat it as a regular expression and search for ^15 for example.
If you just use a number it will treat it as an ID.
Aha, I didn't know I could use regexs there. Super, that solves the
problem nicely. Thank you.
--
Paul
RS
2017-11-15 23:43:59 UTC
Permalink
From: Derek Kaye
Sent: Wednesday, November 15, 2017 9:08 PM
Post by Derek Kaye
You can treat it as a regular expression and search for ^15 for example.
If you just use a number it will treat it as an ID.
For bears of little brain like me it is perhaps worth pointing out that the
Regex needs to be in quotes.

“^2” will find
17: 20 Years of Power with Huw Edwards - -, BBC Two, b095dxkg
but 2, ^2 and "2" won't. I know the documentation says it is safer to use
quotes for all search strings, but most strings work without.

Best wishes
Richard
RS
2017-11-15 23:57:07 UTC
Permalink
I know the documentation says it is safer to use quotes for all search
strings, but most strings work without.
Sorry I meant to say most single or part word search strings work without
quotes.
Alan Milewczyk
2017-11-18 06:53:59 UTC
Permalink
Post by Paul Oldham
If you try searching for "1834", which is a BBC Radio 4 Xtra
programme, you don't get any matches for the programme
If you want to be very specific
get_iplayer --type radio "^1834 $"

So, for example,
get_iplayer "^This Week$"
will only pick up "This Week" and not "NFL this week"

Rgds

A

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
Alan Milewczyk
2017-11-18 07:34:17 UTC
Permalink
Post by Alan Milewczyk
Post by Paul Oldham
If you try searching for "1834", which is a BBC Radio 4 Xtra
programme, you don't get any matches for the programme
If you want to be very specific
get_iplayer --type radio "^1834 $"
Sorry, that should read :
get_iplayer --type radio "^1834$"


A

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
Ralph Corderoy
2017-11-18 12:05:13 UTC
Permalink
Post by Alan Milewczyk
get_iplayer --type radio "^1834$"
For those that don't know regexps but want to have "wildcarded" searches
consisting of one or more strings that must appear in order, e.g.
`money', `mouth', `13', join them together with `.*', that means any
character repeated zero or more times, to give `money.*mouth.*13'. If
you only want those that start with the first string then prepend `^',
and for those that end with the last string, append `$'.
--
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy
Loading...