[ HTML ] RegEx ( Input ) Utili che potete usare

« Older   Newer »
 
  Share  
.
  1.     +1   Like  
     
    .
    Avatar
    Group
    Amministratore
    Posts
    27,291
    PokéPoints
    +13

    Status
    Anonymous
    RegEx:
    Le RegEx Possono servire a risolvere molti problemi in modo molto veloce.

    Che cosa sono:
    Le RegEx sono una sequenza di caratteri che servono descrivere un insieme di stringhe.

    A cosa Servono?
    Semplice Servono a far ad accettare a textaree/input etc solo alcuni determinati tipo di carattere.

    Testo:
    Regex:
    CODICE
    [A-Za-z]+

    Spiegazione: Con questa Regex Potrete inserire Solo caratteri senza numeri,spazzi ecc.

    Esempio Textbox:


    Testo + Spazio:
    Regex:
    CODICE
    [A-Za-z]+

    Spiegazione: Con questa Regex Potrete inserire Solo caratteri e spazzi senza numeri ecc.

    Esempio Textbox:



    Numeri:
    Regex:
    CODICE
    [0-9]+

    Spiegazione: Con questa Regex Potrete inserire Solo numeri nessun altro carattere.

    Esempio Textbox:




    Numero Telefonico :
    RegEx:
    CODICE
    [0-9]{10,11}

    Spiegazione: Con questa Regex potrete inserire un numero telefonico in questo modo: 0000000000 oppure in questo modo: 00000000000 quindi senza trattino .
    Esempio Textbox:



    Numero Telefonico 2:
    RegEx:
    CODICE
    [0-9]{3,4}\-[0-9]{7}

    Spiegazione: Con questa Regex potrete inserire un numero telefonico in questo modo: 000-0000000 oppure in questo modo: 0000-0000000 Con trattino .

    Esempio Textbox:





    Indirizzo Email:

    RegEx:
    CODICE
    [a-zA-Z0-9_\.]+@[a-zA-Z0-9_\.]+\.[A-Za-z]{2,6}

    Spiegazione: Con questa Regex potrete inserire una email ecco un esempio: [email protected] .
    Esempio Textbox:




    Link:
    RegEx:
    CODICE
    [WWW.,www.,http://,A-z]+[a-zA-Z0-9_\.]+\.[A-Za-z]{2,5}

    Spiegazione: Con questa Regex potrete inserire un link email ecco un esempio:
    CODICE
    WWW.sito.forumfree.it ,http://sito.it, www.sito.it o un semplice sito.it ecc
    Sito non esistente č per un esempio...
    Esempio Textbox:


    Per inserirli in un input html Basterŕ Fare cosě:
    CODICE
    <input type="text" pattern="Qui vostra regex" >


    English:

    RegEx:
    RegEx can be used to solve many problems very quickly.

    What are:
    RegEx is a sequence of characters that are used to describe a set of strings.

    What are needed?
    Used to be simple to accept to textaree / input etc only some certain type of character.

    Text:
    regex :
    CODICE
    [A-Za-z]+

    Explanation: This Regex can enter only characters with no numbers , spaces etc. .

    Example Textbox :


    Text + Space:
    regex :
    CODICE
    [A-Za-z]+

    Explanation: This Regex can only enter characters and numbers without spaces etc. .

    Example Textbox :



    Numbers :
    regex :
    CODICE
    [0-9]+

    Explanation: This Regex can enter only numbers no other characters .

    Example Textbox :




    Phone Number :
    RegEx :
    CODICE
    [0-9] {10,11}

    Explanation: This Regex can enter a phone number like this: 0000000000 or like this: 00000000000 then no hyphen .
    Example Textbox :



    Phone Number 2:
    RegEx :
    CODICE
    [0-9] {3,4}\- [0-9] {7}

    Explanation: This Regex can enter a phone number in this way : 000-0000000 or this way: 0000-0000000 With hyphen.

    Example Textbox :





    Email Address:

    RegEx :
    CODICE
    [a- zA -Z0-9_\ .] + @ [A-zA-Z0 -9_\ .]+\ .[A- Za -z] {2,6}

    Explanation: This Regex can enter an email here's an example : [email protected] .
    Example Textbox :




    Link:
    RegEx :
    CODICE
    [WWW.,www.,http://,A-z]+[a-zA-Z0-9_\.]+\.[A-Za-z]{2,5}

    Explanation: This Regex can insert an email link here is an example:
    CODICE
    WWW.sito.forumfree.it , http://sito.it , www.sito.it or a simple sito.it etc.
    Website that does not exist is an example ...
    Example Textbox :


    place them in an html input Just Doing so :
    CODICE
    <input type="text" pattern="Qui your regex" >


    Guida in continuo aggiornamento...
    Alias:
    Help RegEx
    Aiuto RegEx
    RegEx
    Html
    Javascript
    JS
    Textaree
    Inserire solo numeri in una textarea
    Inserire solo lettere in una textarea
    Inserire solo email in una textarea


    Edited by Paralizer - 31/8/2013, 15:05
     
    .
  2.     +1   Like  
     
    .
    Avatar
    Group
    Amministratore
    Posts
    27,291
    PokéPoints
    +13

    Status
    Anonymous
    Topic Modificato & Alias Inserite.
     
    .
1 replies since 7/3/2012, 22:31   413 views
  Share  
.