English > Support
File Scanner and Regular Expressions
nostra:
1. I want to match \d{5}\s-\s ("04523 - ", for instance) which is at the start of the string and not to capture it, but to capture everything after that match, which is what nostra gave me two posts above. Example:
05013 - Antichrist (2009)
I want to capture only <title> and <year>. First 8 characters are always \d{5}\s-\s
--- Code: ---(?i)^.*\\.*- (?P<title>.*) \((?P<year>[0-9]{4})\).*
--- End code ---
--- Quote ---2. Nostra, it seems that your regex can't capture movie [REC] (2007)?
--- End quote ---
There is no original title here, so you need:
--- Code: ---(?i)^.*\\(?P<title>.*) \((?P<year>[0-9]{4})\).*
--- End code ---
buah:
Tnx, I need now only to handle situation when there are both title and origtitle. I hope I'll figure it out somehow.
But...
--- Quote from: nostra on March 23, 2010, 12:14:18 am ---
--- Quote ---2. Nostra, it seems that your regex can't capture movie [REC] (2007)?
--- End quote ---
There is no original title here, so you need:
--- Code: ---(?i)^.*\\(?P<title>.*) \((?P<year>[0-9]{4})\).*
--- End code ---
--- End quote ---
... it seems that the problem with the [Rec] (2007) movie is how to escape "[" and "]" and make them literal. Also, I have on my mind .45 (2006) movie, or Tristan + Isolde (2006) movie, for example.
They all contain meta-characters in title, that need to be escaped?
nostra:
--- Quote ---They all contain meta-characters in title, that need to be escaped?
--- End quote ---
You escape characters in a regular expression, but not the result of it's work... In your case there is no need to escape smth.
buah:
Dough!
Nostra, although it doesn't work for me, please ignore me until I'm better concentrated. I mean it ;D
[attachment deleted by admin]
nostra:
NMM only suggests original title (I do not know why I did it like this any more, to be honest)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version