ernesto logo
Torna al Magazine
Chiropratico: come trovare chiropratici
consigli
Chiropratico: come trovare chiropratici

Come Trovare un Chiropratico: Consigli e Strumenti.

Trovare un Chiropratico: Strumenti e Consigli Utili.

Scopri come creare un'espressione regolare (regex) che consenta l'uso di lettere, numeri, underscore e trattini in un campo di testo HTML5. In questo articolo, analizziamo i dettagli della sintassi corretta per garantire che il tuo regex funzioni perfettamente, partendo da una lettera e gestendo le combinazioni desiderate.

Trova professionisti vicino a te

Trova professionisti
Q: Regex to allow _ and - I am trying to create a regex to allow any character, number, underscore and hyphen. The user can have any combination of these characters as long as it starts with a letter I have this so far ^[a-zA-Z][a-zA-Z0-9_\-]*$ but this does not seem to be working. Can someone help? I am using a HTML5 pattern for a text field. A: Your regex is correct, except for the fact that you have to include the hyphen in the character class, otherwise it is treated as a range. ^[a-zA-Z][a-zA-Z0-9_-]*$
Ultimo aggiornamento
30 Mar 2025
Davide Moretti
Davide Moretti

Scrive articoli informativi per semplificare la scelta di servizi professionali e comprendere meglio i costi.