You are here:  » Feed Filter with "-" character don't work


Feed Filter with "-" character don't work

Submitted by BigJum on Mon, 2013-11-25 20:33 in

Hi David,

I would like to filter an CSV file by the word "E-Mail". The text field may look like this: "The customer E-Mail is...". My simply filter "Drop Record If Not" with the word "E-Mail" does not work.

What could be the solution?

Thanks in advance!

Regards,
Jum

Submitted by support on Tue, 2013-11-26 08:51

Hello Jum and welcome to the forum!

Drop Record If Not uses a simple PHP strstr() operation which shouldn't be affected by "-" - however if you accidentally used Drop Record If Not RegExp then this would be affected since "-" is used as a range separator within a regular expression. That might be all it is - but if you did want to use Drop Record If Not RegExp for additional flexibility then you could use:

/E\-Mail/i

The "/" characters are the optional expression delimiters which enable you to specify options following the closing "/", in this case "i" which makes the match case insensitive. The "\" character is required to "Escape" the "-" character since it has special meaning within an expression.

Cheers,
David.
--
PriceTapestry.com