View Single Post
Old 02-11-2014, 02:28 PM   #10
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
list comparisons do not accept regexes.

Try using

list_re() [see here]:

Quote:
list_re(src_list, separator, search_re, opt_replace) – Construct a list by first separating src_list into items using the separator character. For each item in the list, check if it matches search_re. If it does, then add it to the list to be returned. If opt_replace is not the empty string, then apply the replacement before adding the item to the returned list.
Using a "^" to match at the start of string (each tag is evaluated as a string in turn) and the negative lookahead (?!matched-regex-to-ignore) we get:

PHP Code:
program:

list_re(
    
field('tags'),
    
',',
    
'^(?!send to .*)',
    
''

So the whole program will look like:

PHP Code:
program:

str_in_list(
    
list_re(
        
field('tags'),
        
",",
        
"^(?!send to .*)",
        
""
    
),
    
",",
    
"First",
    
"First",
    
""

list_re() does not accept a list of regexes, so you must use regex (either|or) for multiple regexes.

Last edited by eschwartz; 02-11-2014 at 02:36 PM.
eschwartz is offline   Reply With Quote