Bug #2021
REOPEN "2012" with miscorrection.
100%
Description
This bug was fixed by Adam and closed. But I found mistyping and wrong character.
url.c line 101
#define URL_RE "^([A-Za-z)://(("UC"+)(:("PC"+))?)?("HC"+)(:([0-9]+))?(/.*)?"
is wrong. You missed ']' and wrong '^'. I believe the meaning of '^' is exclude.
It should be
#define URL_RE "([A-Za-z]+)://(("UC"+)(:("PC"+))?)?("HC"+)(:([0-9]+))?(/.*)?"
History
Updated by Sam Stenvall over 10 years ago
The regular expression is indeed missing both a bracket and a +, but the ^ character in this case indicates that the string should start with whatever comes next to it. It only functions as a negator inside brackets, e.g. [^b] matches everything without a "b".
I can't get this regex to work with some common regex testing tools, I assume it's because it uses Perl functions. Has this ever worked?
Updated by MinGyoon Woo over 10 years ago
Oh, I found one missing character('@') from my correction.
#define URL_RE "([A-Za-z]+)://(("UC"+)(:("PC"+))?@)?("HC"+)(:([0-9]+))?(/.*)?"
In my case, it is work. I think, if you want to test with regex tool, you need to replace "UC", "PC" and "HC" with their regex definitions in url.c.
Updated by Adam Sutton over 10 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset commit:tvheadend|5e777cbdbedf8830118fdc222929ae0352272896.