Feeds tamper find and replace Is it possible with Feeds Tamper to find something in a string and replace all the string with something ?

Ex : I've got a .csv file and column 23 can contain something like:
"XL SSR FR RB" or "XL TL RB"


I need to find if this column contains SSR, and rewrite everyting to 1 or 0

Ex : "XL SSR FR RB"  =&gt; "1"
     "XL TL RB"      =&gt; "0"


Is this something the tamper module can do ?

If it's possible to convert it to boolean it's even better.

Thanks.
So you'll need two tampers for that field. From the manual:


Find replace REGEX
Find and replace a user-specified string using REGEX with an option to limit the number of replacements. See the PHP Manual on PCRE Pattern Syntax for a complete reference, or RegexPal for a quick tester.
Convert to boolean
Convert a user-specified string to boolean, with the option of specifying what to do in the case of no match.


Here is a regular expression that will find SSR and replace the entire string with it.

https://regex101.com/r/aO0uG3/2

/\b(SSR)\b/\1/

Then match SSR in the Convert to boolean tamper. (Note: The regex in the screen shot is now out of date. Use /\b/(SSR)\b/ instead)