Debian Codegraph @

translations/manual/it/regexp.po

raw
1 # SOME DESCRIPTIVE TITLE.
2 # Copyright (C) Kovid Goyal
3 # This file is distributed under the same license as the calibre package.
4 #
5 # Translators:
6 # Antonino Ursino <[email protected]>, 2023
7 # Michele Galimberti <[email protected]>, 2021-2023
8 # SKAL <[email protected]>, 2015
9 # Stefano Avezzù <[email protected]>, 2015
10 # Vincenzo Reale <[email protected]>, 2014,2022
11 msgid ""
12 msgstr ""
13 "Project-Id-Version: calibre\n"
14 "Report-Msgid-Bugs-To: \n"
15 "POT-Creation-Date: 2026-02-17 16:44+0000\n"
16 "PO-Revision-Date: 2014-06-17 08:35+0000\n"
17 "Last-Translator: Michele Galimberti <[email protected]>, 2021-2023\n"
18 "Language-Team: Italian (http://app.transifex.com/calibre/calibre/language/it/)\n"
19 "MIME-Version: 1.0\n"
20 "Content-Type: text/plain; charset=UTF-8\n"
21 "Content-Transfer-Encoding: 8bit\n"
22 "Language: it\n"
23 "Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
24
25 #: ../../../__w/calibre/calibre/manual/regexp.rst:4
26 msgid "All about using regular expressions in calibre"
27 msgstr "Tutto sull'utilizzo delle espressioni regolari in calibre"
28
29 #: ../../../__w/calibre/calibre/manual/regexp.rst:6
30 msgid ""
31 "Regular expressions are features used in many places in calibre to perform "
32 "sophisticated manipulation of e-book content and metadata. This tutorial is "
33 "a gentle introduction to getting you started with using regular expressions "
34 "in calibre."
35 msgstr "Le espressioni regolari sono usate in molte parti di calibre per eseguire manipolazioni avanzate del contenuto e dei metadati degli e-book. Questa guida è un'introduzione amichevole all'uso delle espressioni regolari in calibre."
36
37 #: ../../../__w/calibre/calibre/manual/regexp.rst:11
38 msgid "Contents"
39 msgstr "Contenuti"
40
41 #: ../../../__w/calibre/calibre/manual/regexp.rst:14
42 msgid "First, a word of warning and a word of courage"
43 msgstr "Per prima cosa, una parola di avviso e una di incoraggiamento"
44
45 #: ../../../__w/calibre/calibre/manual/regexp.rst:16
46 msgid ""
47 "This is, inevitably, going to be somewhat technical- after all, regular "
48 "expressions are a technical tool for doing technical stuff. I'm going to "
49 "have to use some jargon and concepts that may seem complicated or "
50 "convoluted. I'm going to try to explain those concepts as clearly as I can, "
51 "but really can't do without using them at all. That being said, don't be "
52 "discouraged by any jargon, as I've tried to explain everything new. And "
53 "while regular expressions themselves may seem like an arcane, black magic "
54 "(or, to be more prosaic, a random string of mumbo-jumbo letters and signs), "
55 "I promise that they are not all that complicated. Even those who understand "
56 "regular expressions really well have trouble reading the more complex ones, "
57 "but writing them isn't as difficult- you construct the expression step by "
58 "step. So, take a step and follow me into the rabbit hole."
59 msgstr "Questa guida sarà, per forza di cose, abbastanza tecnica - dopotutto, le espressioni regolari sono uno strumento tecnico che fa cose tecniche. Dovrò usare dei tecnicismi e dei concetti che potrebbero sembrare complicati o contorti. Farò del mio meglio per spiegare quei concetti il più chiaramente possibile, ma non posso proprio fare a meno di utilizzarli. Detto ciò, non essere scoraggiato da questo gergo, perché ho provato a spiegare tutto ciò che appare per la prima volta. E sebbene le espressioni regolari stesse possano sembrare una magia oscura e misteriosa (o, per essere più prosaici, segni e lettere astrusi messi a caso in una stringa senza senso), ti assicuro che non sono poi così complicati. Anche coloro che capiscono molto bene le espressioni regolari hanno problemi a leggere le più complesse tra di esse, ma scriverle non è così complicato - l'espressione è costruita passo passo. E allora, fai un passo avanti e seguimi nella tana del Bianconiglio"
60
61 #: ../../../__w/calibre/calibre/manual/regexp.rst:19
62 msgid "Where in calibre can you use regular expressions?"
63 msgstr "Dove è possibile utilizzare le espressioni regolari all'interno di calibre?"
64
65 #: ../../../__w/calibre/calibre/manual/regexp.rst:21
66 msgid ""
67 "There are a few places calibre uses regular expressions. There's the "
68 ":guilabel:`Search & replace` in conversion options, metadata detection from "
69 "filenames in the import settings and Search & replace when editing the "
70 "metadata of books in bulk. The calibre book editor can also use regular "
71 "expressions in its :guilabel:`Search and replace` feature. Finally, you can "
72 "use regular expressions when searching the calibre book list and when "
73 "searching inside the calibre E-book viewer."
74 msgstr "Ci sono vari luoghi in cui calibre utilizza le espressioni regolari. C'è :guilabel:`Cerca e sostituisci` nelle opzioni di conversione, l'estrazione dei metadati dai nomi dei file nelle impostazioni di importazione e il Cerca e sostituisci nella modifica di gruppo dei metadati dei libri. Anche l'editor di libri di calibre può usare le espressioni regolari nella sua funzione :guilabel:`Cerca e sostituisci`. Infine puoi usare le espressioni regolari quando cerchi nell'elenco dei libri di calibre e nel Lettore E-book di calibre."
75
76 #: ../../../__w/calibre/calibre/manual/regexp.rst:30
77 msgid "What on earth *is* a regular expression?"
78 msgstr "Cosa diamine *è* un'espressione regolare?"
79
80 #: ../../../__w/calibre/calibre/manual/regexp.rst:32
81 msgid ""
82 "A regular expression is a way to describe sets of strings. A single regular "
83 "expression can *match* a number of different strings. This is what makes "
84 "regular expression so powerful -- they are a concise way of describing a "
85 "potentially large number of variations."
86 msgstr "Un'espressione regolare è un modo per descrivere insiemi di stringhe. Una singola espressione regolare può *associare* una serie di stringhe differenti. È questo che rende le espressioni regolari così potenti -- sono un modo conciso per descrivere un numero potenzialmente alto di variazioni."
87
88 #: ../../../__w/calibre/calibre/manual/regexp.rst:34
89 msgid ""
90 "I'm using string here in the sense it is used in programming languages: a "
91 "string of one or more characters, characters including actual characters, "
92 "numbers, punctuation and so-called whitespace (linebreaks, tabulators etc.)."
93 " Please note that generally, uppercase and lowercase characters are not "
94 "considered the same, thus \"a\" being a different character from \"A\" and "
95 "so forth. In calibre, regular expressions are case insensitive in the Search"
96 " bar, but not in the conversion options. There's a way to make every regular"
97 " expression case insensitive, but we'll discuss that later. It gets "
98 "complicated because regular expressions allow for variations in the strings "
99 "it matches, so one expression can match multiple strings, which is why "
100 "people bother using them at all. More on that in a bit."
101 msgstr "Qui uso stringa con il significato usato nei linguaggi di programmazione: una stringa di uno o più caratteri, che includono caratteri effettivi, numeri, punteggiatura e i cosiddetti \"whitespace\" (testo a capo, tabulazioni, ecc.). Ricorda che generalmente caratteri con maiuscole differenti non sono considerati uguali, ne deriva perciò che \"a\" è un carattere di verso da \"A\", e così via. In calibre, le espressioni regolari non fanno distinzione di maiuscole nella Barra di Ricerca, ma la fanno nelle opzioni di conversione. Esiste un modo per fare in modo che nessuna espressione regolare distingua le maiuscole, ma ne parleremo più avanti. Diventa complicato perché le espressioni regolari permettono varianti nelle stringhe che trovano, e quindi a un'espressione può corrispondere più di una stringa, che è poi la ragione per cui la gente si prende il disturbo di usarle. Più informazioni fra un attimo."
102
103 #: ../../../__w/calibre/calibre/manual/regexp.rst:37
104 msgid "Care to explain?"
105 msgstr "Potresti spiegare meglio?"
106
107 #: ../../../__w/calibre/calibre/manual/regexp.rst:39
108 msgid ""
109 "Well, that's why we're here. First, this is the most important concept in "
110 "regular expressions: *A string by itself is a regular expression that "
111 "matches itself*. That is to say, if I wanted to match the string ``\"Hello, "
112 "World!\"`` using a regular expression, the regular expression to use would "
113 "be ``Hello, World!``. And yes, it really is that simple. You'll notice, "
114 "though, that this *only* matches the exact string ``\"Hello, World!\"``, not"
115 " e.g. ``\"Hello, wOrld!\"`` or ``\"hello, world!\"`` or any other such "
116 "variation."
117 msgstr "Siamo qui per questo. Primo, e questo è il concetto più importante delle espressioni regolari: *Una stringa presa da sola è un'espressione regolare che trova se stessa*. Ovverosia, se volessi trovare la stringa ``\"Ciao, Mondo!\"`` usando un'espressione regolare, l'espressione regolare da usare sarebbe ``Ciao, Mondo!``. E sì, è proprio così semplice. Ti sarai accorto, tuttavia, che questa espressione trova *solo* la stringa esatta ``\"Ciao, Mondo!\"``, non p.es. ``\"Ciao, mOndo!\"`` o ``\"ciao, mondo!\"`` o altre varianti del genere."
118
119 #: ../../../__w/calibre/calibre/manual/regexp.rst:42
120 msgid "That doesn't sound too bad. What's next?"
121 msgstr "Non suona affatto male. E poi?"
122
123 #: ../../../__w/calibre/calibre/manual/regexp.rst:44
124 msgid ""
125 "Next is the beginning of the really good stuff. Remember where I said that "
126 "regular expressions can match multiple strings? This is where it gets a "
127 "little more complicated. Say, as a somewhat more practical exercise, the "
128 "e-book you wanted to convert had a nasty footer counting the pages, like "
129 "\"Page 5 of 423\". Obviously the page number would rise from 1 to 423, thus "
130 "you'd have to match 423 different strings, right? Wrong, actually: regular "
131 "expressions allow you to define sets of characters that are matched: To "
132 "define a set, you put all the characters you want to be in the set into "
133 "square brackets. So, for example, the set ``[abc]`` would match either the "
134 "character \"a\", \"b\" or \"c\". *Sets will always only match one of the "
135 "characters in the set*. They \"understand\" character ranges, that is, if "
136 "you wanted to match all the lower case characters, you'd use the set "
137 "``[a-z]`` for lower- and uppercase characters you'd use ``[a-zA-Z]`` and so "
138 "on. Got the idea? So, obviously, using the expression ``Page [0-9] of 423`` "
139 "you'd be able to match the first 9 pages, thus reducing the expressions "
140 "needed to three: The second expression ``Page [0-9][0-9] of 423`` would "
141 "match all two-digit page numbers, and I'm sure you can guess what the third "
142 "expression would look like. Yes, go ahead. Write it down."
143 msgstr "Poi inizia la parte davvero interessante. Ricordi quando ti ho detto che le espressioni regolari possono trovare più di una stringa? È qui che le cose si complicano. Poniamo, come esercizio un po' più concreto, che l'e-book che volevi convertire avesse un fastidioso piè di pagina con la conta delle pagine, come \"Pagina 5 di 423\". Ovviamente il numero di pagina salirebbe da 1 a 423, per cui dovresti trovare 423 stringhe differenti, giusto? Sbagliato in realtà: le espressioni regolari ti permettono di definire classi di caratteri da trovare: per definirne uno, metti tutti i caratteri che vuoi avere nella classe dentro parentesi quadre. Quindi, ad esempio, la classe ``[abc]`` troverebbe sia il carattere \"a\", sia \"b\" sia \"c\". *Le classi troveranno sempre solamente uno dei caratteri della classe.* Esse \"riconoscono\" gli intervalli, ovvero, se volessi trovare tutti i caratteri minuscoli dovresti usare la classe ``[a-z]``, per tutti i caratteri minuscoli e maiuscoli dovresti usare ``[a-zA-Z]``, e così via. Chiaro il concetto? Quindi, ovviamente, usando l'espressione ``Pagina [0-9] di 423`` saresti in grado di trovare le prime 9 pagine, riducendo quindi il numero di espressioni necessarie a tre: la seconda espressione ``Pagina [0-9][0-9] di 423`` troverebbe tutti i numeri di pagina di due cifre, e sono sicuro che tu possa immaginare l'aspetto della terza espressione. Esatto, vai pure. Scrivila."
144
145 #: ../../../__w/calibre/calibre/manual/regexp.rst:47
146 msgid "Hey, neat! This is starting to make sense!"
147 msgstr "Ehi, ben fatto! Ora inizia ad avere un senso!"
148
149 #: ../../../__w/calibre/calibre/manual/regexp.rst:49
150 msgid ""
151 "I was hoping you'd say that. But brace yourself, now it gets even better! We"
152 " just saw that using sets, we could match one of several characters at once."
153 " But you can even repeat a character or set, reducing the number of "
154 "expressions needed to handle the above page number example to one. Yes, ONE!"
155 " Excited? You should be! It works like this: Some so-called special "
156 "characters, \"+\", \"?\" and \"*\", *repeat the single element preceding "
157 "them*. (Element means either a single character, a character set, an escape "
158 "sequence or a group (we'll learn about those last two later)- in short, any "
159 "single entity in a regular expression). These characters are called "
160 "wildcards or quantifiers. To be more precise, \"?\" matches *0 or 1* of the "
161 "preceding element, \"*\" matches *0 or more* of the preceding element and "
162 "\"+\" matches *1 or more* of the preceding element. A few examples: The "
163 "expression ``a?`` would match either \"\" (which is the empty string, not "
164 "strictly useful in this case) or \"a\", the expression ``a*`` would match "
165 "\"\", \"a\", \"aa\" or any number of a's in a row, and, finally, the "
166 "expression ``a+`` would match \"a\", \"aa\" or any number of a's in a row "
167 "(Note: it wouldn't match the empty string!). Same deal for sets: The "
168 "expression ``[0-9]+`` would match *every integer number there is*! I know "
169 "what you're thinking, and you're right: If you use that in the above case of"
170 " matching page numbers, wouldn't that be the single one expression to match "
171 "all the page numbers? Yes, the expression ``Page [0-9]+ of 423`` would match"
172 " every page number in that book!"
173 msgstr "Speravo proprio che lo dicessi. Ma aspetta, ora diventa ancora più bello! Abbiamo appena visto che usando le classi possiamo trovare un carattere tra molti inclusi. Ma puoi anche ripetere un carattere o una classe, e ridurre così il numero di espressioni necessarie per gestire l’esempio dei numeri di pagina di poco fa a uno. Esatto, UNO! Eccitato? Dovresti esserlo! Funziona così: Alcuni cosiddetti caratteri speciali, \"+\", \"?\" e \"*\", *ripetono l’elemento singolo che li precede*. Per elemento si intende un singolo carattere, una classe di caratteri, una sequenza di escape o un gruppo (Di questi ultimi due parleremo più avanti) – in breve ogni entità singola in un’espressione regolare. Questi caratteri sono chiamati wildcard o quantificatori. Per essere più precisi, \"?\" trova *0 o 1* dell’elemento che lo precede, \"*\" trova *0 o più* dell’elemento che lo precede e \"+\" trova *1 o più* dell’elemento che lo precede. Alcuni esempi: l’espressione ``a?`` troverebbe sia \"\" (che è la stringa vuota, non proprio utile nel nostro caso) sia \"a\", l’espressione ``a*`` troverebbe \"\", \"a\", \"aa\" o un qualsiasi numero di a messe in fila e, infine, l’espressione ``a+`` troverebbe \"a\", \"aa\" o un qualsiasi numero di a messe in fila (Nota: non troverebbe la stringa vuota!). Lo stesso vale per le classi: l’espressione ``[0-9]+`` troverebbe *ogni numero intero che c’è*! So cosa stai pensando, e hai ragione: se usassi questa espressione nel caso di prima dei numeri di pagina, non sarebbe questa l’espressione unica che trova tutti i numeri di pagina? Sì, l’espressione ``Pagina [0-9]+ di 423`` troverebbe tutti I numeri di pagina in quel libro!"
174
175 #: ../../../__w/calibre/calibre/manual/regexp.rst:52
176 msgid ""
177 "A note on these quantifiers: They generally try to match as much text as "
178 "possible, so be careful when using them. This is called \"greedy "
179 "behaviour\"- I'm sure you get why. It gets problematic when you, say, try to"
180 " match a tag. Consider, for example, the string ``\"<p "
181 "class=\"calibre2\">Title here</p>\"`` and let's say you'd want to match the "
182 "opening tag (the part between the first pair of angle brackets, a little "
183 "more on tags later). You'd think that the expression ``<p.*>`` would match "
184 "that tag, but actually, it matches the whole string! (The character \".\" is"
185 " another special character. It matches anything *except* linebreaks, so, "
186 "basically, the expression ``.*`` would match any single line you can think "
187 "of). Instead, try using ``<p.*?>`` which makes the quantifier ``\"*\"`` non-"
188 "greedy. That expression would only match the first opening tag, as intended."
189 " There's actually another way to accomplish this: The expression "
190 "``<p[^>]*>`` will match that same opening tag- you'll see why after the next"
191 " section. Just note that there quite frequently is more than one way to "
192 "write a regular expression."
193 msgstr "Un appunto su questi quantificatori: di solito cercano di trovare la maggior quantità di testo possibile, quindi fai attenzione quando li usi. Questo è detto \"comportamento vorace\" - sono sicuro che capisci perché. Questo comportamento diventa problematico quando, poniamo, provi a trovare un tag. Considera per esempio la stringa ``\"<p class=\"calibre2\">Titolo qui</p>\"`` e poniamo che tu voglia trovare il tag di apertura (la parte inclusa nella prima coppia di parentesi angolari, maggiori informazioni sui tag più avanti). Ti verrebbe da pensare che l'espressione ``<p.*>`` trovi quel tag, ma in realtà trova l'intera stringa! (Il carattere \".\" è un altro carattere speciale. Trova ogni carattere tranne le interruzioni di riga quindi, in pratica, l'espressione ``.*`` troverebbe ogni singola linea immaginabile). Invece, prova a usare ``<p.*?>`` che rende il quantificatore ``\"*\"`` non vorace. Quell'espressione troverebbe solo il primo tag di apertura, come si voleva. C'è anche un altro modo per ottenere la stessa cosa, in realtà: l'espressione ``<p[^>]*>`` troverà lo stesso tag di apertura - capirai perché dopo la prossima sezione. Ricorda solo che c'è spesso più di un modo di scrivere un'espressione regolare."
194
195 #: ../../../__w/calibre/calibre/manual/regexp.rst:56
196 msgid ""
197 "Well, these special characters are very neat and all, but what if I wanted "
198 "to match a dot or a question mark?"
199 msgstr "Bene, questi caratteri speciali sono tutti molto graziosi, ma se volessi trovare un punto, o un punto di domanda?"
200
201 #: ../../../__w/calibre/calibre/manual/regexp.rst:58
202 msgid ""
203 "You can of course do that: Just put a backslash in front of any special "
204 "character and it is interpreted as the literal character, without any "
205 "special meaning. This pair of a backslash followed by a single character is "
206 "called an escape sequence, and the act of putting a backslash in front of a "
207 "special character is called escaping that character. An escape sequence is "
208 "interpreted as a single element. There are of course escape sequences that "
209 "do more than just escaping special characters, for example ``\"\\t\"`` means"
210 " a tabulator. We'll get to some of the escape sequences later. Oh, and by "
211 "the way, concerning those special characters: Consider any character we "
212 "discuss in this introduction as having some function to be special and thus "
213 "needing to be escaped if you want the literal character."
214 msgstr "Puoi farlo, naturalmente: Basta mettere una barra rovesciata prima di ogni carattere speciale e sarà interpretato come il carattere digitato, senza alcun significato speciale. Questa coppia di barra rovesciata seguita da un carattere singolo è chiamata sequenza di escape, e l'atto di mettere una barra rovesciata prima di un carattere speciale è detto (in inglese) \"escaping the character\". Una sequenza di escape è interpretata come un singolo elemento. Naturalmente ci sono sequenze di escape che fanno di più che rappresentare semplicemente i caratteri speciali, per esempio ``\"\\t\"`` indica una tabulazione. Parleremo di alcune di queste sequenze di escape più avanti. Ah e comunque, riguardo a quei caratteri speciali: Considera che ognuno dei caratteri di cui discutiamo in questa introduzione perché hanno una certa funzione sia speciale, e che quindi abbia bisogno della barra di escape se vuoi il carattere digitato."
215
216 #: ../../../__w/calibre/calibre/manual/regexp.rst:61
217 msgid "So, what are the most useful sets?"
218 msgstr "Quindi, quali sono le classi più utili?"
219
220 #: ../../../__w/calibre/calibre/manual/regexp.rst:63
221 msgid ""
222 "Knew you'd ask. Some useful sets are ``[0-9]`` matching a single number, "
223 "``[a-z]`` matching a single lowercase letter, ``[A-Z]`` matching a single "
224 "uppercase letter, ``[a-zA-Z]`` matching a single letter and ``[a-zA-Z0-9]`` "
225 "matching a single letter or number. You can also use an escape sequence as "
226 "shorthand:"
227 msgstr "Sapevo che l'avresti chiesto. Alcune utili classi sono ``[0-9]`` che trova una singola cifra, ``[a-z]`` che trova una singola lettera minuscola, ``[A-Z]`` che trova una singola lettera maiuscola, ``[a-zA-Z]`` che trova una singola lettera e ``[a-zA-Z0-9]`` che trova una singola lettera o numero. Puoi anche usare una sequenza di escape per fare più in fretta:"
228
229 #: ../../../__w/calibre/calibre/manual/regexp.rst:69
230 msgid "``\\d``"
231 msgstr "``\\d``"
232
233 #: ../../../__w/calibre/calibre/manual/regexp.rst:70
234 msgid "is equivalent to ``[0-9]``"
235 msgstr "è equivalente a ``[0-9]``"
236
237 #: ../../../__w/calibre/calibre/manual/regexp.rst:72
238 msgid "``\\w``"
239 msgstr "``\\w``"
240
241 #: ../../../__w/calibre/calibre/manual/regexp.rst:73
242 msgid "is equivalent to ``[a-zA-Z0-9_]``"
243 msgstr "è equivalente a ``[a-zA-Z0-9_]``"
244
245 #: ../../../__w/calibre/calibre/manual/regexp.rst:76
246 msgid "``\\s``"
247 msgstr "``\\s``"
248
249 #: ../../../__w/calibre/calibre/manual/regexp.rst:77
250 msgid "is equivalent to any whitespace"
251 msgstr "è equivalente a un qualunque spazio"
252
253 #: ../../../__w/calibre/calibre/manual/regexp.rst:80
254 msgid ""
255 "\"Whitespace\" is a term for anything that won't be printed. These "
256 "characters include space, tabulator, line feed, form feed, carriage return, "
257 "non-breaking spaces, etc."
258 msgstr "Con \"spazio\" si intende qualsiasi cosa non venga stampata. Questi caratteri includono il normale spazio, il rientro (tabulazione), testo a capo, interruzione di pagina, ritorno a inizio riga, spazio unificatore, ecc."
259
260 #: ../../../__w/calibre/calibre/manual/regexp.rst:83
261 msgid ""
262 "The upper and lower case sets may match both upper and lowercase if the "
263 "setting to make searches case insensitive is enabled. Such settings are "
264 "found, for instance in Preferences->Searching in calibre itself and on the "
265 "Search panel in the calibre :guilabel:`E-book viewer` as well as the calibre"
266 " :guilabel:`Edit book` tool."
267 msgstr "Le classi di maiuscole e minuscole possono corrispondere a entrambe se è abilitata l'impostazione che non distingue tra maiuscole e minuscole. Tali impostazioni si trovano, ad esempio, in Preferenze->Ricerca in calibre stesso e nel pannello di ricerca del :guilabel:`Lettore e-book` di calibre, così come nello strumento :guilabel:`Modifica libro`."
268
269 #: ../../../__w/calibre/calibre/manual/regexp.rst:89
270 msgid ""
271 "As a last note on sets, you can also define a set as any character *but* "
272 "those in the set. You do that by including the character ``\"^\"`` as the "
273 "*very first character in the set*. Thus, ``[^a]`` would match any character "
274 "excluding \"a\". That's called complementing the set. Those escape sequence "
275 "shorthands we saw earlier can also be complemented: ``\"\\D\"`` means any "
276 "non-number character, thus being equivalent to ``[^0-9]``. The other "
277 "shorthands can be complemented by, you guessed it, using the respective "
278 "uppercase letter instead of the lowercase one. So, going back to the example"
279 " ``<p[^>]*>`` from the previous section, now you can see that the character "
280 "set it's using tries to match any character except for a closing angle "
281 "bracket."
282 msgstr "Come nota conclusiva sulle classi, puoi anche definire una classe composta di tutti i caratteri *tranne* quelli nella classe. Puoi far ciò includendo il carattere ``\"^\"`` come *primo carattere della classe*. In questo modo, ``[^a]`` troverebbe ogni carattere eccetto \"a\". Questa operazione è detta \"integrare la classe\". Anche le sequenze di escape abbreviate che abbiamo visto in precedenza possono essere integrate: ``\"\\D\"`` significa qualunque carattere non numerico, essendo perciò equivalente a ``[^0-9]``. Le altre sequenze abbreviate possono essere integrate usando, hai indovinato, le rispettive lettere maiuscole invece di quelle minuscole. Quindi, tornando all'esempio ``<p[^>]*>`` della sezione precedente, ora puoi vedere che la classe di caratteri utilizzata prova a trovare un qualsiasi carattere eccetto una parentesi angolare di chiusura."
283
284 #: ../../../__w/calibre/calibre/manual/regexp.rst:94
285 msgid ""
286 "But if I had a few varying strings I wanted to match, things get "
287 "complicated?"
288 msgstr "Ma se avessi alcune stringhe diverse tra loro da trovare, diventerebbe complicato?"
289
290 #: ../../../__w/calibre/calibre/manual/regexp.rst:96
291 msgid ""
292 "Fear not, life still is good and easy. Consider this example: The book "
293 "you're converting has \"Title\" written on every odd page and \"Author\" "
294 "written on every even page. Looks great in print, right? But in e-books, "
295 "it's annoying. You can group whole expressions in normal parentheses, and "
296 "the character ``\"|\"`` will let you match *either* the expression to its "
297 "right *or* the one to its left. Combine those and you're done. Too fast for "
298 "you? Okay, first off, we group the expressions for odd and even pages, thus "
299 "getting ``(Title)(Author)`` as our two needed expressions. Now we make "
300 "things simpler by using the vertical bar (``\"|\"`` is called the vertical "
301 "bar character): If you use the expression ``(Title|Author)`` you'll either "
302 "get a match for \"Title\" (on the odd pages) or you'd match \"Author\" (on "
303 "the even pages). Well, wasn't that easy?"
304 msgstr "Niente paura, non c'è niente di più semplice. Considera questo esempio: Il libro che stai convertendo ha scritto \"Titolo\" su tutte le pagine dispari e \"Autore\" su tutte le pagine pari. Molto carino su carta, vero? Ma in un e-book, è fastidioso. Puoi raggruppare intere espressioni tra normali parentesi tonde, e il carattere ``\"|\"`` ti farà trovare *o* l'espressione alla sua destra *o* quella alla sua sinistra. Combinale ed è fatta. Ho spiegato troppo in fretta? Va bene, per prima cosa raggruppiamo le espressioni per le pagine pari e dispari, ottenendo così le due espressioni che ci servono ``(Titolo)(Autore)``. Ora rendiamo le cose più semplici usando la barra verticale (``\"|\"`` è detto carattere di barra verticale): Se usi l'espressione ``(Titolo)|(Autore)`` troverai o un risultato per \"Titolo\" (nelle pagine dispari) o un risultato per \"Autore\" (nelle pagine pari). Abbastanza semplice, no?"
305
306 #: ../../../__w/calibre/calibre/manual/regexp.rst:98
307 msgid ""
308 "You can, of course, use the vertical bar without using grouping parentheses,"
309 " as well. Remember when I said that quantifiers repeat the element preceding"
310 " them? Well, the vertical bar works a little differently: The expression "
311 "\"Title|Author\" will also match either the string \"Title\" or the string "
312 "\"Author\", just as the above example using grouping. *The vertical bar "
313 "selects between the entire expression preceding and following it*. So, if "
314 "you wanted to match the strings \"Calibre\" and \"calibre\" and wanted to "
315 "select only between the upper- and lowercase \"c\", you'd have to use the "
316 "expression ``(c|C)alibre``, where the grouping ensures that only the \"c\" "
317 "will be selected. If you were to use ``c|Calibre``, you'd get a match on the"
318 " string \"c\" or on the string \"Calibre\", which isn't what we wanted. In "
319 "short: If in doubt, use grouping together with the vertical bar."
320 msgstr "Naturalmente puoi usare la barra verticale anche senza le parentesi di raggruppamento. Ricordi quando ho detto che i quantificatori ripetono l'elemento che li precede? Ecco, la barra verticale funziona in un modo leggermente diverso: Anche l'espressione \"Titolo|Autore\" troverà o la stringa \"Titolo\" o la stringa \"Autore\", esattamente come l'esempio precedente con il raggruppamento. *La barra verticale sceglie tra l'intera espressione che la precede e quella che la segue*. Quindi, se volessi trovare le stringhe \"Calibre\" e \"calibre\" e volessi distinguere solo tra la \"c\" maiuscola e minuscola, dovresti usare l'espressione ``(c|C)alibre``, in cui il raggruppamento fa in modo che solo la \"c\" venga selezionata. Se invece avessi usato ``c|Calibre``, avresti ottenuto una corrispondenza con la stringa \"c\" o con la stringa \"Calibre\", che non è quello che volevamo. In breve: Nel dubbio, usa il raggruppamento insieme alla barra verticale."
321
322 #: ../../../__w/calibre/calibre/manual/regexp.rst:101
323 msgid "You missed..."
324 msgstr "Ti sei dimenticato..."
325
326 #: ../../../__w/calibre/calibre/manual/regexp.rst:103
327 msgid ""
328 "... wait just a minute, there's one last, really neat thing you can do with "
329 "groups. If you have a group that you previously matched, you can use "
330 "references to that group later in the expression: Groups are numbered "
331 "starting with 1, and you reference them by escaping the number of the group "
332 "you want to reference, thus, the fifth group would be referenced as ``\\5``."
333 " So, if you searched for ``([^ ]+) \\1`` in the string \"Test Test\", you'd "
334 "match the whole string!"
335 msgstr "... fermo fermo fermo, c'è un'ultima cosa molto uitle che puoi fare con i gruppi. Se hai catturato un gruppo in precedenza, puoi riferirti a quel gruppo più avanti nell'espressione stessa: I gruppi sono numerati a partire da 1, e puoi riferirti ad essi con il loro numero. Il quinto gruppo, per esempio, sarebbe richiamato da ``\\5``. Quindi, se cercassi ``([^ ]+) \\1`` nella stringa \"Test Test\", troveresti l'intera stringa!"
336
337 #: ../../../__w/calibre/calibre/manual/regexp.rst:107
338 msgid ""
339 "In the beginning, you said there was a way to make a regular expression case"
340 " insensitive?"
341 msgstr "All'inizio hai detto che c'era un modo di creare un'espressione regolare che non distingue le maiuscole?"
342
343 #: ../../../__w/calibre/calibre/manual/regexp.rst:109
344 msgid ""
345 "Yes, I did, thanks for paying attention and reminding me. You can tell "
346 "calibre how you want certain things handled by using something called flags."
347 " You include flags in your expression by using the special construct "
348 "``(?flags go here)`` where, obviously, you'd replace \"flags go here\" with "
349 "the specific flags you want. For ignoring case, the flag is ``i``, thus you "
350 "include ``(?i)`` in your expression. Thus, ``(?i)test`` would match "
351 "\"Test\", \"tEst\", \"TEst\" and any case variation you could think of."
352 msgstr "Sì, l'ho fatto, grazie per aver prestato attenzione e avermelo ricordato. Puoi dire a calibre come vuoi che certe cose vengano gestite usando qualcosa chiamato flag. Puoi includere i flag nella tua espressione utilizzando il costrutto speciale ``(?i flag vanno qui)`` dove, ovviamente, sostituirai \"i flag vanno qui\" con i flag specifici che desideri. Per ignorare maiuscole e minuscole, il flag è ``i``, quindi includi ``(?i)`` nella tua espressione. In questo modo, ``(?i)test`` troverà una corrispondenza con \"Test\", \"tEst\", \"TEst\" e qualsiasi altra variazione di maiuscole e minuscole a cui potresti pensare."
353
354 #: ../../../__w/calibre/calibre/manual/regexp.rst:111
355 msgid ""
356 "Another useful flag lets the dot match any character at all, *including* the"
357 " newline, the flag ``s``. If you want to use multiple flags in an "
358 "expression, just put them in the same statement: ``(?is)`` would ignore case"
359 " and make the dot match all. It doesn't matter which flag you state first, "
360 "``(?si)`` would be equivalent to the above."
361 msgstr "Un altro utile flag fa in modo che a un punto corrispondano tutti i caratteri *incluso* il carattere newline, il flag ``s``. Se vuoi usare più di un flag in un'espressione, inseriscile semplicemente nella stessa espressione: ``(?is)`` ignorerà maiuscole e minuscole e farà corrispondere il punto a tutti i caratteri. Non importa quale flag specifichi per prima, ``(?si)`` darà gli stessi risultati."
362
363 #: ../../../__w/calibre/calibre/manual/regexp.rst:114
364 msgid ""
365 "I think I'm beginning to understand these regular expressions now... how do "
366 "I use them in calibre?"
367 msgstr "Penso di stare iniziando a capire queste espressioni regolari... Come le posso usare in calibre?"
368
369 #: ../../../__w/calibre/calibre/manual/regexp.rst:117
370 msgid "Conversions"
371 msgstr "Conversioni"
372
373 #: ../../../__w/calibre/calibre/manual/regexp.rst:119
374 msgid ""
375 "Let's begin with the conversion settings, which is really neat. In the "
376 ":guilabel:`Search & replace` part, you can input a regexp (short for regular"
377 " expression) that describes the string that will be replaced during the "
378 "conversion. The neat part is the wizard. Click on the wizard staff and you "
379 "get a preview of what calibre \"sees\" during the conversion process. Scroll"
380 " down to the string you want to remove, select and copy it, paste it into "
381 "the regexp field on top of the window. If there are variable parts, like "
382 "page numbers or so, use sets and quantifiers to cover those, and while "
383 "you're at it, remember to escape special characters, if there are some. Hit "
384 "the button labeled :guilabel:`Test` and calibre highlights the parts it "
385 "would replace were you to use the regexp. Once you're satisfied, hit OK and "
386 "convert. Be careful if your conversion source has tags like this example::"
387 msgstr "Iniziamo dalle impostazioni di conversione, che hanno potenzialità interessanti. Nella scheda :guilabel:`Cerca & sostituisci`, puoi inserire una regex (abbreviazione di \"regular expression\") che descrive la stringa da sostituire durante la conversione. La parte davvero interessante è la procedura guidata. Clicca sulla bacchetta magica per mostrare un'anteprima di ciò che calibre \"vede\" durante il processo di conversione. Scorri verso il basso fino alla stringa che vuoi rimuovere, selezionala e copiala, poi incollala nel campo regex nella parte alta della finestra. Se ci sono parti variabili come numeri di pagina o altro, usa le classi e i quantificatori per catturarli, e già che ci sei, ricordati di usare la sequenza di escape per i caratteri speciali, se ce ne sono. Premi il pulsante :guilabel:`Prova` e calibre evidenzierà le parti che sostiruirebbe se usassi quella regex. Quando sei soddisfatto, premi OK per convertire. Fai attenzione se la sorgente per la conversione contiene tag come quelli di questo esempio::"
388
389 #: ../../../__w/calibre/calibre/manual/regexp.rst:129
390 msgid ""
391 "(shamelessly ripped out of `this thread "
392 "<https://www.mobileread.com/forums/showthread.php?t=75594\">`_). You'd have "
393 "to remove some of the tags as well. In this example, I'd recommend beginning"
394 " with the tag ``<b class=\"calibre2\">``, now you have to end with the "
395 "corresponding closing tag (opening tags are ``<tag>``, closing tags are "
396 "``</tag>``), which is simply the next ``</b>`` in this case. (Refer to a "
397 "good HTML manual or ask in the forum if you are unclear on this point). The "
398 "opening tag can be described using ``<b.*?>``, the closing tag using "
399 "``</b>``, thus we could remove everything between those tags using "
400 "``<b.*?>.*?</b>``. But using this expression would be a bad idea, because it"
401 " removes everything enclosed by <b>- tags (which, by the way, render the "
402 "enclosed text in bold print), and it's a fair bet that we'll remove portions"
403 " of the book in this way. Instead, include the beginning of the enclosed "
404 "string as well, making the regular expression "
405 "``<b.*?>\\s*Generated\\s+by\\s+ABC\\s+Amber\\s+LIT.*?</b>`` The ``\\s`` with"
406 " quantifiers are included here instead of explicitly using the spaces as "
407 "seen in the string to catch any variations of the string that might occur. "
408 "Remember to check what calibre will remove to make sure you don't remove any"
409 " portions you want to keep if you test a new expression. If you only check "
410 "one occurrence, you might miss a mismatch somewhere else in the text. Also "
411 "note that should you accidentally remove more or fewer tags than you "
412 "actually wanted to, calibre tries to repair the damaged code after doing the"
413 " removal."
414 msgstr "(vergognosamente copiata da `questa discussione <https://www.mobileread.com/forums/showthread.php?t=75594\">`_). Ci sarebbero da rimuovere anche alcuni dei tag. In questo esempio, ti consiglio di iniziare dal tag ``<b class=\"calibre2\">``, dopodiché devi rimuovere il tag di chiusura corrispondente (i tag di apertura sono ``<tag>``, quelli di chiusura sono ``</tag>``), che in questo caso è semplicemente il ``</b>`` successivo (se questo punto non ti è chiaro, fai riferimento a un buon manuale di HTML o chiedi aiuto sul forum). Il tag di apertura può essere descritto da ``<b.*?>``, quello di chiusura da ``</b>``, perciò potremmo rimuovere tutto ciò che si trova tra i due tag con ``<b.*?>.*?</b>``. Usare questa espressione però non sarebbe una buona idea, perché rimuoverebbe qualunque testo racchiuso da tag <b> (che, come nota, applica il grassetto al testo racchiuso) ed è più che probabile che parti del libro verrebbero rimosse come conseguenza. Conviene invece includere anche la parte iniziale della stringa racchiusa, usando l'espressione regolare ``<b.*?>\\s*Generated\\s+by\\s+ABC\\s+Amber\\s+LIT.*?</b>`` `Invece di digitare esplicitamente gli spazi della stringa, viene usato `\\s`` con i quantificatori, per catturare ogni possibile variazione della stringa. Se provi una nuova espressione ricorda di controllare tutte le rimozioni che calibre applicherà, per essere sicuro di non rimuovere parti che vuoi conservare. Se ne controlli solamente una, potresti perderti una corrispondenza non voluta da un'altra parte nel testo. Ricorda anche che se dovessi rimuovere più (o meno) tag di quelli che volevi, calibre proverà a riparare il codice danneggiato dopo la rimozione."
415
416 #: ../../../__w/calibre/calibre/manual/regexp.rst:132
417 msgid "Adding books"
418 msgstr "Aggiunta di libri"
419
420 #: ../../../__w/calibre/calibre/manual/regexp.rst:134
421 msgid ""
422 "Another thing you can use regular expressions for is to extract metadata "
423 "from filenames. You can find this feature in the \"Adding books\" part of "
424 "the settings. There's a special feature here: You can use field names for "
425 "metadata fields, for example ``(?P<title>)`` would indicate that calibre "
426 "uses this part of the string as book title. The allowed field names are "
427 "listed in the windows, together with another nice test field. An example: "
428 "Say you want to import a whole bunch of files named like ``Classical Texts: "
429 "The Divine Comedy by Dante Alighieri.mobi``. (Obviously, this is already in "
430 "your library, since we all love classical Italian poetry) or ``Science "
431 "Fiction epics: The Foundation Trilogy by Isaac Asimov.epub``. This is "
432 "obviously a naming scheme that calibre won't extract any meaningful data out"
433 " of - its standard expression for extracting metadata is ``(?P<title>.+) - "
434 "(?P<author>[^_]+)``. A regular expression that works here would be "
435 "``[a-zA-Z]+: (?P<title>.+) by (?P<author>.+)``. Please note that, inside the"
436 " group for the metadata field, you need to use expressions to describe what "
437 "the field actually matches. And also note that, when using the test field "
438 "calibre provides, you need to add the file extension to your testing "
439 "filename, otherwise you won't get any matches at all, despite using a "
440 "working expression."
441 msgstr ""
442
443 #: ../../../__w/calibre/calibre/manual/regexp.rst:138
444 msgid "Bulk editing metadata"
445 msgstr "Modifica di gruppo dei metadati"
446
447 #: ../../../__w/calibre/calibre/manual/regexp.rst:140
448 msgid ""
449 "The last part is regular expression :guilabel:`Search and replace` in "
450 "metadata fields. You can access this by selecting multiple books in the "
451 "library and using bulk metadata edit. Be very careful when using this last "
452 "feature, as it can do **Very Bad Things** to your library! Double-check that"
453 " your expressions do what you want them to using the test fields, and only "
454 "mark the books you really want to change! In the regular expression search "
455 "mode, you can search in one field, replace the text with something and even "
456 "write the result into another field. A practical example: Say your library "
457 "contained the books of Frank Herbert's Dune series, named after the fashion "
458 "``Dune 1 - Dune``, ``Dune 2 - Dune Messiah`` and so on. Now you want to get "
459 "``Dune`` into the series field. You can do that by searching for ``(.*?) "
460 "\\d+ - .*`` in the title field and replacing it with ``\\1`` in the series "
461 "field. See what I did there? That's a reference to the first group you're "
462 "replacing the series field with. Now that you have the series all set, you "
463 "only need to do another search for ``.*? -`` in the title field and replace "
464 "it with ``\"\"`` (an empty string), again in the title field, and your "
465 "metadata is all neat and tidy. Isn't that great? By the way, instead of "
466 "replacing the entire field, you can also append or prepend to the field, so,"
467 " if you *wanted* the book title to be prepended with series info, you could "
468 "do that as well. As you by now have undoubtedly noticed, there's a checkbox "
469 "labeled :guilabel:`Case sensitive`, so you won't have to use flags to select"
470 " behaviour here."
471 msgstr ""
472
473 #: ../../../__w/calibre/calibre/manual/regexp.rst:142
474 msgid ""
475 "Well, that just about concludes the very short introduction to regular "
476 "expressions. Hopefully I'll have shown you enough to at least get you "
477 "started and to enable you to continue learning by yourself- a good starting "
478 "point would be the `Python documentation for regexps "
479 "<https://docs.python.org/library/re.html>`_."
480 msgstr "Bene, con ciò abbiamo quasi finito questa breve introduzione alle espressioni regolari. Con un po' di fortuna ti avrò mostrato abbastanza per farti almeno partire e permetterti di continuare a imparare per conto tuo - un buon posto dove guardare sarebbe `Python documentation for regexps <https://docs.python.org/library/re.html>`_."
481
482 #: ../../../__w/calibre/calibre/manual/regexp.rst:144
483 msgid ""
484 "One last word of warning, though: Regexps are powerful, but also really easy"
485 " to get wrong. calibre provides really great testing possibilities to see if"
486 " your expressions behave as you expect them to. Use them. Try not to shoot "
487 "yourself in the foot. (God, I love that expression...). But should you, "
488 "despite the warning, injure your foot (or any other body parts), try to "
489 "learn from it."
490 msgstr "Un ultimo avviso, però: nonostante le espressioni regolari siano molto potenti, è anche molto facile sbagliare nel crearle. calibre fornisce ottime funzioni di prova per controllare se le tue espressioni funzionano come ti aspetti. Usale. Cerca di evitare di spararti nel piede. (Cielo, quanto mi piace questa espressione...). Ma anche se dovessi, nonostante i preavvisi, ferirti al piede (o in altre parti anatomiche), prova ad imparare da quanto successo."
491
492 #: ../../../__w/calibre/calibre/manual/regexp.rst:148
493 msgid "Quick reference"
494 msgstr "Riferimenti rapidi"
495
496 #: ../../../__w/calibre/calibre/manual/regexp.rst:156
497 msgid "Credits"
498 msgstr "Riconoscimenti"
499
500 #: ../../../__w/calibre/calibre/manual/regexp.rst:158
501 msgid "Thanks for helping with tips, corrections and such:"
502 msgstr "Grazie per aver contribuito con consigli, correzioni e altro:"
503
504 #: ../../../__w/calibre/calibre/manual/regexp.rst:160
505 msgid "ldolse"
506 msgstr "ldolse"
507
508 #: ../../../__w/calibre/calibre/manual/regexp.rst:161
509 msgid "kovidgoyal"
510 msgstr "kovidgoyal"
511
512 #: ../../../__w/calibre/calibre/manual/regexp.rst:162
513 msgid "chaley"
514 msgstr "chaley"
515
516 #: ../../../__w/calibre/calibre/manual/regexp.rst:163
517 msgid "dwanthny"
518 msgstr "dwanthny"
519
520 #: ../../../__w/calibre/calibre/manual/regexp.rst:164
521 msgid "kacir"
522 msgstr "kacir"
523
524 #: ../../../__w/calibre/calibre/manual/regexp.rst:165
525 msgid "Starson17"
526 msgstr "Starson17"
527
528 #: ../../../__w/calibre/calibre/manual/regexp.rst:166
529 msgid "Orpheu"
530 msgstr "Orpheu"
531
532 #: ../../../__w/calibre/calibre/manual/regexp.rst:168
533 msgid ""
534 "For more about regexps see `The Python User Manual "
535 "<https://docs.python.org/library/re.html>`_. The actual regular expression "
536 "library used by calibre is: `regex <https://bitbucket.org/mrabarnett/mrab-"
537 "regex/src/hg/>`_ which supports several useful enhancements over the Python "
538 "standard library one."
539 msgstr "Per più informazioni sulle regex vedi `The Python User Manual <https://docs.python.org/library/re.html>`_. In realtà la libreria usata da calibre per le espressioni regolari è `regex <https://bitbucket.org/mrabarnett/mrab-regex/src/hg/>`_, che supporta vari utili miglioramenti rispetto alla libreria standard di Python."