Visualizzazione dei risultati da 1 a 5 su 5

Discussione: Regex i18n

  1. #1

    Regex i18n

    Ciao.
    Scusate il titolo ma penso renda l'idea.
    Sto cercando una regex che mi accetti
    tutte le lettere anche quelle proprie
    di un dato paese ad esempio
    č,ģ per l'italia
    ē per la francia
    e cosģ via
    gli spazi e anche il famigerato '

    Deve accettare ad esempio
    De andrč
    Dell'anēois
    Rossi
    ho tirato fuori dal cilindro
    questa regex

    $string1= "Dell'Oglič";
    var_dump(preg_match("#^\D+\'?\s?\D+$#", $string1));
    $string1= "De G3lič";
    var_dump(preg_match("#^\D+\'?\s?\D+$#", $string1));
    #^\D+\'?\s?\D+$#

    va bč l'apostrofo č \'

    Puoi andar bene ?

    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  2. #2
    "#^\D+\'?\s?\D+$#"
    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  3. #3
    $string1= " #Dell'Oglič";

    Non ci siamo idee ?


    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  4. #4
    #^\w+\'?\s?\w+$#

    questa non accetta i caratteri speciali
    ma accetta numeri


    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  5. #5
    #^[[:alpha:]]+\\'?\s?[[:alpha:]]*$#

    occhio agli escapes


    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.