O GoConqr está de visual novo! Conte para nós o que você achou.

Mapa mental

REGULAR EXPRESSION

Nguyet Huynh JavaScript Beginner Inglês

Conteúdo do mapa

REGULAR EXPRESSION

  1. Create REGEXP

    • var re1 = new RegExp("abc");
    • var re2 = /abc/;
    • Use cach 2: khi gap dau phai: var re3 = /abc\+/;
  2. Method

    • .test()
      • string container match of pattern?
      • return true - contain, false - not contain
      • console.log(/abc/.test("abcde");
        • Kiem tra trong chuoi "abcde" co abc ko?
        • //true
    • exec()
      • return null - not match, obj with info aboutn match - contain
      • var match = /\d+/exec("one two 100"); console.log(match); console.log(match.index)
    • .match()
      • Chn # exec()
      • console.log("one two 100".match(/\d+/)); //["100"]
    • replace()
      • replace part of the string with another string
      • console.log("papa".replace("p", "m"));
  3. Repeat part of pattern

    • put (+) after sth in regexp
      • --> repeated more than once
      • console.log(/'\d+'/.test("'123'"));
    • put (*)
      • may occur zero time
      • console.log('\d*'/\.test(" '123' ")); //true
      • console.log('\d*/\.test(" '' ");
    • put ?
      • may occur 0 or 1 time
      • var neighbor = /neoghbo?r/; console.log(neighbor.test("neighbour")); console.log(neighbor.test("neighbor"));
  4. Date Type

    • Obj type 4 represent date
    • Create
      • new Date() -> current date and time
      • new Date(2016, 12, 9) -> specific time
    • feature
      • month start at 0 (December is 11)
      • Day numbers start at 1
      • Unix time
        • timestamp store number of millisecond since the start of 1970
        • negative number 4 times before 1970
        • Create-> new Date(1387407600000)
  5. Pattern (xem anh)

    • http://www.w3schools.com/jsref/jsref_obj_regexp.asp

Informações

Descrição
Beginner JavaScript Mapa Mental sobre REGULAR EXPRESSION, criado por Nguyet Huynh em 09-12-2016.
Criado por
Nguyet Huynh
Visualizações
1
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?