ILoveMyGreyhound

Regular Expressions and Rules

Recommended Posts

Hello Melissa.

This is nice idea. I've moved and pinned this topic in our FAQ section.

Here we can comment RegExs and help each other for this powerful feature.

I'll start first with some links about RegEx. :)

 

Online tool to learn, build and test Regular Expressions

 

Another good articles to start with (from our blog):

 

Share this post


Link to post
Share on other sites

Can I use a regex in a normal search? I don't see a Search Option except for "Advanced syntax" which does not seem to be what I want. The online tool to test expressions is nice, but it would be great if I can test my expression on my own feeds.

Share this post


Link to post
Share on other sites

Can I use a regex in a normal search? I don't see a Search Option except for "Advanced syntax" which does not seem to be what I want. The online tool to test expressions is nice, but it would be great if I can test my expression on my own feeds.

Regular expressions will work only for Rules.

Share this post


Link to post
Share on other sites

I have a regex rule for a folder, but it doesn't seem to work so I would like to ask for help to identify what is wrong with my setup.

 

Match any of the following:

Title or content doesn't contain ([Nn]on(-|\s)?local(ity)?)|([Pp]lasmon(ics?)?)

=> Mark as read

 

It seems that all articles in the folder are marked as read regardless of whether there is a match to the regex. For example, this morning, an article with the following title was automatically marked as read "Nonlocal homogenization for nonlinear metamaterials." "Nonlocal" clearly matches the regex, so I don't understand. Any explanation will be greatly appreciated!

Share this post


Link to post
Share on other sites

Hello, 

In the conditions You should use "doesn't match regular expression" or "match regular expression" if you want to use regular expressions, not "doesn't contain". 

Also you must wrap your expressions in forward slashes like /[Bb][Bb][Cc]/ig

Please test and let us know if you need additional help using Regex-es. 

Share this post


Link to post
Share on other sites
7 hours ago, wesson said:

Hello, 

In the conditions You should use "doesn't match regular expression" or "match regular expression" if you want to use regular expressions, not "doesn't contain". 

Also you must wrap your expressions in forward slashes like /[Bb][Bb][Cc]/ig

Please test and let us know if you need additional help using Regex-es. 

Thanks a lot. I feel dumb to have missed this, but it's the first time that I tried to use rules and didn't look thoroughly enough in the options to see that there is regex match in the drop down menu.

I updated my regular expression to the following: /(non(-|\s)?local(ity)?)|(plasmon(ics?)?)/ig

Hopefully it will work. I will be able to tell soon enough and will edit this message or reply here to confirm.

EDIT: Works like a charm. Thanks for your amazing help!

Share this post


Link to post
Share on other sites

Hi,

a question for guys who have experience with complex rules and/or regular expressions. I am looking for the best practice solution for this problem:

What I want to do is to tag an article based on which tags it has. For example: an articles comes in and gets tag A based on rule/criteria list A and gets a tag B based on rule/criteria list B. So far so simple and the article is tagged A and B.

But now I want to make a rule "if the article is tagged A and is tagged B, then add a tag "C" to it"

In my understanding such a rule is not possible with the standard tools.

Many thanks in advance!

 

EDIT/PS: I know I could do the rule if article is tagged A and criteria B is fulfilled, add tag B and C". This works but has the huge disadvantage that one has to update the "criteria B" in multiple rules plus the fact that their is another rule necessary to tag B.

Share this post


Link to post
Share on other sites
On 7/8/2018 at 2:36 PM, maddhin said:

I want to make a rule "if the article is tagged A and is tagged B, then add a tag C to it"

Anybody any idea how this could work? 🤔🤯😜🙏

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now