mjf314 on Feb 12 2018, 08:45:22 AM wrote:The URL has to be preceded by a comma because I want it to ignore IMDb URLs that people write in comments (it's not very common, but it could happen).
Do you mean by comments the notes you can add for any movie while editing a list on IMDb? In that case a short regex will still work if you only use the first match per line; their CSVs have IMDb IDs in the second column so a proper ID will be matched regardless of comments. It's still a hack that relies on the column order not changing though, in my scripts I now try to do full CSV parsing (with stdlib or any decent 3rd-party library) so that I can refer to the field I need by its column name and pray they don't rename the columns
By the way, what about comments that just have an IMDb link to another movie as a comment? This for example will cause your regex to match an offensively wrong link:
Code: Select all
Position,Const,Created,Modified,Description,Title,URL,Title Type,IMDb Rating,Runtime (mins),Year,Genres,Num Votes,Release Date,Directors,Your Rating,Date Rated