nerevu / riko

A Python stream processing engine modeled after Yahoo! Pipes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unable to get regex filter rules working

Fuzzwah opened this issue · comments

I've got everything working for simple "contains" filters:

>>> flow = SyncPipe('fetch', conf={'url': 'https://news.ycombinator.com/rss'}).filter(conf={'rule': {'field': 'title', 'op': 'contains', 'value': 'Uber'}})
>>> stream = flow.output
>>> for i in stream:
...     print(i['title'])
...
Uber Said to Merge China Business with Didi in $35B Deal
>>>

However, when I'm trying to use regex filter rules I think I'm missing something:

>>> flow = SyncPipe('fetch', conf={'url': 'https://news.ycombinator.com/rss'}).filter(conf={'rule': {'field': 'title', 'op': 'matches', 'value': 'Uber'}})
>>> stream = flow.output
>>> for i in stream:
...     print(i['title'])
...
>>>

I haven't been able to dig up an example in the repo which shows 'op': 'matches' in action.

Any tips?