|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Jan 2002
Città: Napoli
Messaggi: 1727
|
Trattino in regexp
Ciao a tutti, sto cercando di scrivere una regexp:
attualmente ho: Codice:
(\\d+) Lo vorrei mettere in OR con un trattino, cioè può esserci Codice:
232323 Codice:
- Solo che non trovo come faccio a specificare un "trattino". avreste un'idea a riguardo, thanks!
__________________
Se buttassimo in un cestino tutto ciò che in Italia non funziona cosa rimarrebbe? Il cestino. |
|
|
|
|
|
#2 | |
|
Senior Member
Iscritto dal: Nov 2005
Città: TO
Messaggi: 5206
|
Quote:
\d+|-
__________________
Andrea, SCJP 5 (91%) - SCWCD 5 (94%) |
|
|
|
|
|
|
#3 | |
|
Senior Member
Iscritto dal: Jan 2002
Città: Napoli
Messaggi: 1727
|
Quote:
Comunque quello che ho trovato è questo, come ti sembra? Codice:
"(\\d+)|([-])"
__________________
Se buttassimo in un cestino tutto ciò che in Italia non funziona cosa rimarrebbe? Il cestino. |
|
|
|
|
|
|
#4 | |
|
Senior Member
Iscritto dal: Jan 2002
Città: Napoli
Messaggi: 1727
|
Quote:
Codice:
"(\\d+|-)" Ora le tonde mi servono perchè io devo estrarre tante stringhe da una stringona. e in un certo punto di questa mi posso trovare O un numero, O un trattino.
__________________
Se buttassimo in un cestino tutto ciò che in Italia non funziona cosa rimarrebbe? Il cestino. |
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 07:56.



















