This was further discussed in a private message, thought i would put the resolution back here in case others we interested.
After installing the custom text columns addon mentioned above.
Requirement 1:
Let’s say i want to extact these things from “Gotham - 1x01 - Le Regole Di Gotham”:
1 - Gotham
2 - Stagione 1, where “Stagione” is added manually by me and 1 is the 1x01 of the season
Solution
{
"columns": [
{
"name": "test-season",
"label": "test-season",
"header": "test-season",
"type": "text",
"defwidth": "20",
"justify": "left",
"infotiponly": false,
"maxstars": "5",
"datetimeformat": "yyyy-mm-dd",
"noGroup": false,
"grouporder": "",
"sorting": "normal",
"regexp": ".*\\s-\\s(\\d)x(\\d\\d).*",
"inputItemProperty": "name_stem",
"firstValid": false,
"output": "Stagione $1",
"filter": "all",
"nogroup": false
},
{
"name": "test-name",
"label": "test-name",
"header": "test-name",
"type": "text",
"defwidth": "20",
"justify": "left",
"infotiponly": false,
"maxstars": "5",
"datetimeformat": "yyyy-mm-dd",
"noGroup": false,
"grouporder": "",
"sorting": "normal",
"regexp": "(.*?)\\s-\\s.*",
"inputItemProperty": "name_stem",
"firstValid": false,
"output": "$1",
"filter": "all",
"nogroup": false
}
]
}
The dialog for the columns simply saves some config in to a global variable. You can replace all the column config with the config I sent above.
- Go here Global Variable Management Dialog and grab the addon and install it.
- Open the Vars dialog
- Find the variable called RegexpCustomColumnsConfig
- Paste JSON in that the value section.
If you would rather make the custom columns with the dialog.
Column1:
Name: Season
Regexp: .*\s-\s(\d)x(\d\d).*
Output: Stagione $1
Column2:
Name: Name
Regexp: (.*?)\s-\s.*
Output: $1
Requirement 2:
- Episode 001, and you want Episode and 001.
- Name Surname - Episode 002, and you want Episode and 002.
Solution
Notice there are multiple capture groups now.
^(.*?\s-\s)?(.*)\s(\d{1,3})$
Testing in expresso.