{"action":"created","comment":{"url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/comments/38806734","id":38806734,"diff_hunk":"@@ -1,84 +1,95 @@\n-/*\n-1. Envolva todo o conteúdo desse desafio em uma IIFE.\n-2. Adicione a diretiva 'use strict';\n-3. Crie um arquivo index.html e adicione esse script à ele.\n-*/\n+(function(){\n+\t'use strict'\n+\t/*\n+\t1. Envolva todo o conteúdo desse desafio em uma IIFE.\n+\t2. Adicione a diretiva 'use strict';\n+\t3. Crie um arquivo index.html e adicione esse script à ele.\n+\t*/\n \n-/*\n-Alguns detalhes importantes que faltou falar na aula:\n-1. O objeto RegExp() pode receber um segundo parâmetro, que são as flags:\n-- var justNumbersAndLetters = new RegExp( '[\\\\da-z]', 'gi' );\n-2. Como a expressão regular passada para o objeto RegExp() é uma string,\n-ela pode ser concatenada para gerar uma regex em tempo de execução,\n-diferente da regex literal, onde toda a regex precisa estar pronta antes\n-da utilização.\n-*/\n+\t/*\n+\tAlguns detalhes importantes que faltou falar na aula:\n+\t1. O objeto RegExp() pode receber um segundo parâmetro, que são as flags:\n+\t- var justNumbersAndLetters = new RegExp( '[\\\\da-z]', 'gi' );\n+\t2. Como a expressão regular passada para o objeto RegExp() é uma string,\n+\tela pode ser concatenada para gerar uma regex em tempo de execução,\n+\tdiferente da regex literal, onde toda a regex precisa estar pronta antes\n+\tda utilização.\n+\t*/\n \n-/*\n-- Usando o construtor de Regex, crie uma regex que case somente com números\n-no início da string. O match precisa ser feito para todas as\n-correspondências de qualquer string, não somente para a primeira, ainda que\n-esta tenha muitas linhas, deve sempre casar com números no início de cada\n-linha, independente de quantos caracteres de número estiverem juntos.\n-- Atribua essa regex à uma variável chamada `justNumbersRegex` e mostre-a\n-no console:\n-*/\n-console.log( 'Regex para números usando o construtor:' );\n-// ?\n+\t/*\n+\t- Usando o construtor de Regex, crie uma regex que case somente com números\n+\tno início da string. O match precisa ser feito para todas as\n+\tcorrespondências de qualquer string, não somente para a primeira, ainda que\n+\testa tenha muitas linhas, deve sempre casar com números no início de cada\n+\tlinha, independente de quantos caracteres de número estiverem juntos.\n+\t- Atribua essa regex à uma variável chamada `justNumbersRegex` e mostre-a\n+\tno console:\n+\t*/\n+\tconsole.log( 'Regex para números usando o construtor:' );\n+\tvar justNumbersRegex = new RegExp('^\\\\d+','gm');\n+\tconsole.log( justNumbersRegex );\n \n-/*\n-Verifique se a regex acima casa com o texto na variável `text`, mostrando o\n-resultado no console. O resultado deve ser:\n-\"[ '10', '50' ]\"\n-*/\n-var text = '10 anos.\\n50 discos vendidos.\\nE nem 10% dos meus amigos o conhece.';\n-console.log( '\\nNúmeros no início da linha do texto:\\n' + text, '\\n' );\n-// ?\n+\t/*\n+\tVerifique se a regex acima casa com o texto na variável `text`, mostrando o\n+\tresultado no console. O resultado deve ser:\n+\t\"[ '10', '50' ]\"\n+\t*/\n+\tvar text = '10 anos.\\n50 discos vendidos.\\nE nem 10% dos meus amigos o conhece.';\n+\tconsole.log( '\\nNúmeros no início da linha do texto:\\n' + text, '\\n' );\n+\tconsole.log( text.match(justNumbersRegex) );\n \n-/*\n-- Crie uma regex que case com números no final de uma string. Atribua a\n-regex à uma variável chamada `numbersAtTheEnd`.\n-- A regex deve casar com todas as correspondências de qualquer string, ainda\n-que esta tenha muitas linhas, deve sempre casar com números no fim de cada\n-linha, independente de quantos caracteres de número estiverem juntos.\n-Mostre a regex no console:\n-*/\n-console.log( '\\nRegex para números somente no final das linhas:' );\n-// ?\n+\t/*\n+\t- Crie uma regex que case com números no final de uma string. Atribua a\n+\tregex à uma variável chamada `numbersAtTheEnd`.\n+\t- A regex deve casar com todas as correspondências de qualquer string, ainda\n+\tque esta tenha muitas linhas, deve sempre casar com números no fim de cada\n+\tlinha, independente de quantos caracteres de número estiverem juntos.\n+\tMostre a regex no console:\n+\t*/\n+\tconsole.log( '\\nRegex para números somente no final das linhas:' );\n+\tvar numbersAtTheEnd = new RegExp( '\\\\d+$', 'gm' );","path":"challenge-19/challenge-19.js","position":93,"original_position":93,"commit_id":"915b020208ccdf1fc9c68dfb9223c3001e82ff54","original_commit_id":"915b020208ccdf1fc9c68dfb9223c3001e82ff54","user":{"login":"fdaciuk","id":487669,"avatar_url":"https://avatars.githubusercontent.com/u/487669?v=3","gravatar_id":"","url":"https://api.github.com/users/fdaciuk","html_url":"https://github.com/fdaciuk","followers_url":"https://api.github.com/users/fdaciuk/followers","following_url":"https://api.github.com/users/fdaciuk/following{/other_user}","gists_url":"https://api.github.com/users/fdaciuk/gists{/gist_id}","starred_url":"https://api.github.com/users/fdaciuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fdaciuk/subscriptions","organizations_url":"https://api.github.com/users/fdaciuk/orgs","repos_url":"https://api.github.com/users/fdaciuk/repos","events_url":"https://api.github.com/users/fdaciuk/events{/privacy}","received_events_url":"https://api.github.com/users/fdaciuk/received_events","type":"User","site_admin":false},"body":"-1\r\nFaltou mostrar no console ;) ","created_at":"2015-09-05T03:11:22Z","updated_at":"2015-09-05T03:11:22Z","html_url":"https://github.com/da2k/curso-javascript-ninja/pull/295#discussion_r38806734","pull_request_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/295","_links":{"self":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/comments/38806734"},"html":{"href":"https://github.com/da2k/curso-javascript-ninja/pull/295#discussion_r38806734"},"pull_request":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/295"}}},"pull_request":{"url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/295","id":43624019,"html_url":"https://github.com/da2k/curso-javascript-ninja/pull/295","diff_url":"https://github.com/da2k/curso-javascript-ninja/pull/295.diff","patch_url":"https://github.com/da2k/curso-javascript-ninja/pull/295.patch","issue_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/295","number":295,"state":"open","locked":false,"title":"Challenge 19","user":{"login":"andersonweb","id":3930770,"avatar_url":"https://avatars.githubusercontent.com/u/3930770?v=3","gravatar_id":"","url":"https://api.github.com/users/andersonweb","html_url":"https://github.com/andersonweb","followers_url":"https://api.github.com/users/andersonweb/followers","following_url":"https://api.github.com/users/andersonweb/following{/other_user}","gists_url":"https://api.github.com/users/andersonweb/gists{/gist_id}","starred_url":"https://api.github.com/users/andersonweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersonweb/subscriptions","organizations_url":"https://api.github.com/users/andersonweb/orgs","repos_url":"https://api.github.com/users/andersonweb/repos","events_url":"https://api.github.com/users/andersonweb/events{/privacy}","received_events_url":"https://api.github.com/users/andersonweb/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-28T12:46:33Z","updated_at":"2015-09-05T03:11:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ca977c8aeefe7cb84a2b335da604174ba1c48d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/295/commits","review_comments_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/295/comments","review_comment_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/comments{/number}","comments_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/295/comments","statuses_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/statuses/915b020208ccdf1fc9c68dfb9223c3001e82ff54","head":{"label":"andersonweb:challenge-19","ref":"challenge-19","sha":"915b020208ccdf1fc9c68dfb9223c3001e82ff54","user":{"login":"andersonweb","id":3930770,"avatar_url":"https://avatars.githubusercontent.com/u/3930770?v=3","gravatar_id":"","url":"https://api.github.com/users/andersonweb","html_url":"https://github.com/andersonweb","followers_url":"https://api.github.com/users/andersonweb/followers","following_url":"https://api.github.com/users/andersonweb/following{/other_user}","gists_url":"https://api.github.com/users/andersonweb/gists{/gist_id}","starred_url":"https://api.github.com/users/andersonweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersonweb/subscriptions","organizations_url":"https://api.github.com/users/andersonweb/orgs","repos_url":"https://api.github.com/users/andersonweb/repos","events_url":"https://api.github.com/users/andersonweb/events{/privacy}","received_events_url":"https://api.github.com/users/andersonweb/received_events","type":"User","site_admin":false},"repo":{"id":33542266,"name":"curso-javascript-ninja","full_name":"andersonweb/curso-javascript-ninja","owner":{"login":"andersonweb","id":3930770,"avatar_url":"https://avatars.githubusercontent.com/u/3930770?v=3","gravatar_id":"","url":"https://api.github.com/users/andersonweb","html_url":"https://github.com/andersonweb","followers_url":"https://api.github.com/users/andersonweb/followers","following_url":"https://api.github.com/users/andersonweb/following{/other_user}","gists_url":"https://api.github.com/users/andersonweb/gists{/gist_id}","starred_url":"https://api.github.com/users/andersonweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersonweb/subscriptions","organizations_url":"https://api.github.com/users/andersonweb/orgs","repos_url":"https://api.github.com/users/andersonweb/repos","events_url":"https://api.github.com/users/andersonweb/events{/privacy}","received_events_url":"https://api.github.com/users/andersonweb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andersonweb/curso-javascript-ninja","description":"Curso Javascript Ninja","fork":true,"url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja","forks_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/forks","keys_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/teams","hooks_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/hooks","issue_events_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/issues/events{/number}","events_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/events","assignees_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/assignees{/user}","branches_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/branches{/branch}","tags_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/tags","blobs_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/git/refs{/sha}","trees_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/statuses/{sha}","languages_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/languages","stargazers_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/stargazers","contributors_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/contributors","subscribers_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/subscribers","subscription_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/subscription","commits_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/commits{/sha}","git_commits_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/git/commits{/sha}","comments_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/comments{/number}","issue_comment_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/issues/comments{/number}","contents_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/contents/{+path}","compare_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/merges","archive_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/downloads","issues_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/issues{/number}","pulls_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/pulls{/number}","milestones_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/milestones{/number}","notifications_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/labels{/name}","releases_url":"https://api.github.com/repos/andersonweb/curso-javascript-ninja/releases{/id}","created_at":"2015-04-07T12:38:34Z","updated_at":"2015-05-06T02:46:07Z","pushed_at":"2015-09-04T14:15:00Z","git_url":"git://github.com/andersonweb/curso-javascript-ninja.git","ssh_url":"git@github.com:andersonweb/curso-javascript-ninja.git","clone_url":"https://github.com/andersonweb/curso-javascript-ninja.git","svn_url":"https://github.com/andersonweb/curso-javascript-ninja","homepage":"http://blog.da2k.com.br/curso-javascript-ninja/","size":351,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"da2k:master","ref":"master","sha":"4746b4a908cdd533660470553333570911c824d1","user":{"login":"da2k","id":11011075,"avatar_url":"https://avatars.githubusercontent.com/u/11011075?v=3","gravatar_id":"","url":"https://api.github.com/users/da2k","html_url":"https://github.com/da2k","followers_url":"https://api.github.com/users/da2k/followers","following_url":"https://api.github.com/users/da2k/following{/other_user}","gists_url":"https://api.github.com/users/da2k/gists{/gist_id}","starred_url":"https://api.github.com/users/da2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/da2k/subscriptions","organizations_url":"https://api.github.com/users/da2k/orgs","repos_url":"https://api.github.com/users/da2k/repos","events_url":"https://api.github.com/users/da2k/events{/privacy}","received_events_url":"https://api.github.com/users/da2k/received_events","type":"Organization","site_admin":false},"repo":{"id":30896610,"name":"curso-javascript-ninja","full_name":"da2k/curso-javascript-ninja","owner":{"login":"da2k","id":11011075,"avatar_url":"https://avatars.githubusercontent.com/u/11011075?v=3","gravatar_id":"","url":"https://api.github.com/users/da2k","html_url":"https://github.com/da2k","followers_url":"https://api.github.com/users/da2k/followers","following_url":"https://api.github.com/users/da2k/following{/other_user}","gists_url":"https://api.github.com/users/da2k/gists{/gist_id}","starred_url":"https://api.github.com/users/da2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/da2k/subscriptions","organizations_url":"https://api.github.com/users/da2k/orgs","repos_url":"https://api.github.com/users/da2k/repos","events_url":"https://api.github.com/users/da2k/events{/privacy}","received_events_url":"https://api.github.com/users/da2k/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/da2k/curso-javascript-ninja","description":"Curso Javascript Ninja","fork":false,"url":"https://api.github.com/repos/da2k/curso-javascript-ninja","forks_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/forks","keys_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/keys{/key_id}","collaborators_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/teams","hooks_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/hooks","issue_events_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/events{/number}","events_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/events","assignees_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/assignees{/user}","branches_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/branches{/branch}","tags_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/tags","blobs_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/git/refs{/sha}","trees_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/git/trees{/sha}","statuses_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/statuses/{sha}","languages_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/languages","stargazers_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/stargazers","contributors_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/contributors","subscribers_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/subscribers","subscription_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/subscription","commits_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/commits{/sha}","git_commits_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/git/commits{/sha}","comments_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/comments{/number}","issue_comment_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/comments{/number}","contents_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/contents/{+path}","compare_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/compare/{base}...{head}","merges_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/merges","archive_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/downloads","issues_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues{/number}","pulls_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls{/number}","milestones_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/milestones{/number}","notifications_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/labels{/name}","releases_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/releases{/id}","created_at":"2015-02-17T00:57:58Z","updated_at":"2015-08-28T02:25:52Z","pushed_at":"2015-09-04T23:52:45Z","git_url":"git://github.com/da2k/curso-javascript-ninja.git","ssh_url":"git@github.com:da2k/curso-javascript-ninja.git","clone_url":"https://github.com/da2k/curso-javascript-ninja.git","svn_url":"https://github.com/da2k/curso-javascript-ninja","homepage":"http://blog.da2k.com.br/curso-javascript-ninja/","size":2717,"stargazers_count":36,"watchers_count":36,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":48,"forks":41,"open_issues":48,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/295"},"html":{"href":"https://github.com/da2k/curso-javascript-ninja/pull/295"},"issue":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/295"},"comments":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/295/comments"},"review_comments":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/295/comments"},"review_comment":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/295/commits"},"statuses":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/statuses/915b020208ccdf1fc9c68dfb9223c3001e82ff54"}}}}