Re: Series - Fix inputs of 1of6 to S01E01
Posted: 28 Mar 2023, 10:27
= is the assignment operator. This is completely wrong. Syntactically correct, but doesn't do what you think it does.
== is the equals operator. Still wrong, because you're using a regex on the right-hand side.
=~ is the regex-find operator. ==~ is the regex-match operator. Those make sense if you want to check if the first genre matches regex /Documentary|News/.
Note that {genre} is equivalent to { genres[0] } and thus always the first genre. { genre[0] } would be first letter of the first genre.
The simple solution is this:
** I've added this example to the list: viewtopic.php?t=4191
== is the equals operator. Still wrong, because you're using a regex on the right-hand side.
=~ is the regex-find operator. ==~ is the regex-match operator. Those make sense if you want to check if the first genre matches regex /Documentary|News/.


Code: Select all
{ genre ==~ /Documentary|News/ ? 'Documentaries' : 'TV Shows' }