Quote:
Originally Posted by Tharos
I need some help (ok, a lot of help) with the metadata. Maybe someone has time to look into my problems.
What is it about. I am trying to change the metadata of several pages via [defaults]. And then later to modify it page specific.
|
Requests for assistance are almost always easier to help with when example story URLs showing the problem are given.
In this case, I can point out what I
see that's wrong, but I'm not going to be able to test with stories to try.
- In exclude_metadata_pre lines: you are using '==' which matches exact string, but giving regexp patterns for several. Change '==' to '=~', or don't use regexp patterns there.
- It's your choice, but changing the value of status can prevent FFF's Custom Column settings from working when assigning to a boolean column using the GUI config page.
- Changing site (or storyId or storyUrl) can cause subtle problems because those values are used internally. I'd use publisher instead; that's what gets set in Calibre Publisher column.
- exclude_metadata_pre settings under [site] sections are overriding those in [defaults]. Use add_to_exclude_metadata_pre in the [site] sections to add instead of replace. See https://github.com/JimmXinu/FanFicFare/wiki/INI-File
- Not a problem, just a way to save some text: replace_metadata lines will be applied to all metadata entries if you skip the list. Example:
Code:
replace_metadata:
Adventure\/Action=>Adventure\,Action
That doesn't work with include/exclude lines.
Quote:
Originally Posted by Tharos
Q4: What is the difference between "^(Manipulative(.*)?)$" and "^Manipulative$"? I want to delete or change all tags that start with this word. I can't figure out from the examples here in the forum what the right way is.
|
Regular expressions can be difficult to understand for new users, but they are powerful and already available in most programming languages. There are many tutorials and introductory pages out there: Google regexp or regular expressions. FFF uses Python regexp in the few cases it makes a difference.
Very briefly:
^ means start of string and
$ means end of string.
So
^Manipulative$ matches the string "Manipulative" and nothing else.
Parens:
( and
) are the grouping mechanism which is used to make more complex patterns and to pass
part of the matched expression into the replacement using \1, \2 etc for each set of parens left to right.
The dot
. in regexp matches any character. Star
* means "0 or more of the previous character or grouping".
? means "0 or 1 of the previous character or grouping".
Effectively,
^(Manipulative(.*)?)$ matches any string that starts with "Manipulative". The parens in this case are unneeded.
^Manipulative.*$ is equivalent. And it renders
^Manipulative$ redundant.