Regex filtering example

Regex filtering example

jenkojenko Posts: 6Questions: 0Answers: 0
edited December 2009 in General
Can someone please post an example that would filter for "str1" or "str2" or "str3" -- that is, all rows that had any of those three would appear in the table. I have looked at the online doc, but can't figure it out.

something like fnFilter("str1" || "str2" || "str3")

Thank you.

2 minutes after posting, I figured it out. :(

SOLUTION: fnFilter("str1|str2|str3",colnum,false)

Replies

  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin
    Hi jenko,

    Good to hear you got a solution. This works well for a single column, but if you (or anyone else reading this) wanted to have an 'OR' search occurring on all columns, DataTables actually does this automatically using space seperated words. So fnFilter( "str1 str2 str3" ), would do it.

    Regards,
    Allan
This discussion has been closed.