|
2 | 2 |
|
3 | 3 | Il confine di parola `pattern:\b` è un test, proprio come `pattern:^` e `pattern:$`. |
4 | 4 |
|
5 | | -When the regexp engine (program module that implements searching for regexps) comes across `pattern:\b`, it checks that the position in the string is a word boundary. |
| 5 | +Quando l'interprete delle regexp (il modulo software che cerca all'interno delle espressioni regolari) si imbatte in `pattern:\b`, verifica se la posizione nella stringa sia un confine di parola. |
6 | 6 |
|
7 | | -There are three different positions that qualify as word boundaries: |
| 7 | +Ci sono tre differenti posizioni che qualificano il confine di parola: |
8 | 8 |
|
9 | | -- At string start, if the first string character is a word character `pattern:\w`. |
10 | | -- Between two characters in the string, where one is a word character `pattern:\w` and the other is not. |
11 | | -- At string end, if the last string character is a word character `pattern:\w`. |
| 9 | +- Ad inizio stringa, se il primo carattere di essa è un carattere di parola `pattern:\w`. |
| 10 | +- Tra due caratteri di una stringa, laddove una sia un carattere di parola `pattern:\w` e l'altro no. |
| 11 | +- A fine stringa, se l'ultimo carattere è un carattere di parola `pattern:\w`. |
12 | 12 |
|
13 | | -For instance, regexp `pattern:\bJava\b` will be found in `subject:Hello, Java!`, where `subject:Java` is a standalone word, but not in `subject:Hello, JavaScript!`. |
| 13 | +Ad esempio, la regexp `pattern:\bJava\b` troverà corrispondenza in `subject:Hello, Java!`, dove `subject:Java` è una parola a sé, ma non troverà alcuna corrispondenza in `subject:Hello, JavaScript!`. |
14 | 14 |
|
15 | 15 | ```js run |
16 | 16 | alert( "Hello, Java!".match(/\bJava\b/) ); // Java |
17 | 17 | alert( "Hello, JavaScript!".match(/\bJava\b/) ); // null |
18 | 18 | ``` |
19 | 19 |
|
20 | | -In the string `subject:Hello, Java!` following positions correspond to `pattern:\b`: |
| 20 | +Nella stringa `subject:Hello, Java!` trovano riscontro in `pattern:\b` le seguenti posizioni: |
21 | 21 |
|
22 | 22 |  |
23 | 23 |
|
|
0 commit comments