transmission-rss icon indicating copy to clipboard operation
transmission-rss copied to clipboard

Confusion around regex formatting

Open mshaberle opened this issue 5 years ago • 5 comments

I am trying to use regex to match a show from my RSS feed. The regex that I am using is confirmed to work after being tested in vim and regexr.com against the output of the RSS feed, but when put into my .conf file it will not produce any matches so I am confused on what I need to do to it to get it to work.

The section of the .conf file in question is set up as follows:

- url: http://website.com/rss
  regexp:
   - matcher: RegExpression
     download_path: /home/user/downloads/ 

The regex that I am using is /(Name)(?=.+(Quality))/g and is set up this way so I can find the name of the show I want and make sure its in the quality that I desire. I have put it in the .conf file as both the regex just shown as well as (Name)(?=.+(Quality)) and I am getting no matches.

mshaberle avatar Dec 10 '19 10:12 mshaberle

Have you tried it with single quotes around your regex string? Yaml sometimes interprets things you wouldn't expect.

technoe avatar Dec 20 '19 02:12 technoe

The latter variant should work. What should be matched by ?=.+?

Generally, Ruby Regex should work, e.g. https://rubular.com/r/86VLGQZiEWkGkN

nning avatar Jan 24 '20 21:01 nning

Uhm, I know this is not the place to ask for assistance, but: is there a way to check if a regexp is doing what I intended?

AvverbioPronome avatar Feb 17 '20 15:02 AvverbioPronome

Uhm, I know this is not the place to ask for assistance, but: is there a way to check if a regexp is doing what I intended?

https://regex101.com/

Jimmy-Z avatar Nov 23 '20 09:11 Jimmy-Z

Um, are these OK regexes for this program?

  1. I want everything from this site:
  • url: https://something.somewhere regexp: '.*'
  1. from here I only want to download something called "My show blah blah"
  • url: https://somewhere.else/rss regexp: /my.show/
  1. From here I want to download everything that contains "restaurant" or "big bunch" in the title..
  • url: https://somewhere.else2 regexp: /restaurant|big.bunch/

Are these the way they were meant to be used?

tkalfaoglu avatar Apr 14 '23 16:04 tkalfaoglu