Now, we're going to learn how to specify important parts of HTML and JavaScript,
and, in an incredible surprise move, we're going to do this specification
using regular expressions.
Just a quick reminder, an outline of the overall project,
we want to start with a web page and then break it down into important words.
Maybe the less than and the greater than sign used for the tag are important words,
the 1, the plus, and the 2, but we're largely ignoring this sort of white space
or these new line characters.
Then we want to take those words and diagram them into this cool tree-like structure.
Of course, this tree is growing upside down, but that won't be a problem at all.
Finally, we're going to interpret that tree to figure out what it means to get the result.
Adesso impariamo come specificare parti importanti di HTML e JavaScript,
e, incredibilmente, lo faremo
usando le espressioni regolari.
Giusto per ricordarci, uno sguardo al progetto complessivo,
vogliamo cominciare da una pagina web, e spezzettarla in parole rilevanti.
Probabilmente il '<' e il '>' delle tag sono parole rilevanti,
come '1' , il più, ed il '2' ; ma ignoriamo questi spazi
o il segno caratteristico per l'andare a capo (new line).
Vogliamo prendere queste parole e disegnarci questo fighissimo diagramma ad albero.
Naturalmente questo albero cresce al contrario, dall'altro verso il basso, ma non sarà un gran problema.
Infine, interpreteremo questo albero per capire cosa significa e poter stampare il risultato.
これからHTMLとJavaScriptの重要な部分を
特定する方法を学んでいきます
正規表現を使えば信じられないほどの速さで
この特定を行うことができます
簡単に確認しますが
プロジェクト全体のアウトラインは
Webページから始まり重要単語に分割することです
おそらくタグに使われている<、>、1、+、2は
重要単語です
しかしここの空白や改行文字などは無視します
次にそれらの文字を木のような構造の図表にします
この木は自然に生える木とは逆向きに成長します
最後に木の意味を理解するために
木を変換し結果を得ます
結果は3です
Agora vamos aprender como especificar partes importantes de HTML e JavaScript,
e, surpreendentemente, vamos fazer essa especificação
usando expressões regulares.
Como um lembrete -- uma idéia geral do projeto --
queremos começar com uma página web e então dividi-la em palavras relevantes.
Talvez os sinais `<`e `>`, usadaos para tags, sejam palavras relevantes,
o `1', o `+' e o `2', mas geralmente ignoramos estes espaços em branco,
ou estes caracteres de fim de linha.
Então queremos pegar essas palavras e organizá-las nesta estrutura de árvore.
É claro que essa é uma árvore de cabeça para baixo, mas isso não será um problema.
Finalmente, vamos interpretar esta árvore, para entender o que significa e obter o resultado.