| Autor |
Mensagem |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 05/04/2011 11:28:53
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
Estou tentando criar uma expressão regular para validar se existe 3 letras(somente) em uma String, alguém poderia me ajudar ?
Desde já agradeço !
This message was edited 1 time. Last update was at 05/04/2011 13:01:06
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 05/04/2011 12:18:13
|
Schuenemann
GUJ Ranger
Membro desde: 13/01/2005 12:31:27
Mensagens: 854
Offline
|
^[a-zA-Z]{3}$
This message was edited 1 time. Last update was at 05/04/2011 12:19:19
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 05/04/2011 13:00:36
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
Schuenemann wrote:^[a-zA-Z]{3}$
Obrigado pela ajuda, depois descobri que o que eu precisava era apenas contar 3 letras em uma String e validar, vou deixar aqui as duas soluções, obrigado:
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 05/04/2011 13:07:59
|
Schuenemann
GUJ Ranger
Membro desde: 13/01/2005 12:31:27
Mensagens: 854
Offline
|
Isso só testa se em algum ponto da string tem isso. "3aaa %e" passa nesse seu teste . E no for use Character.isLetter() e demais métodos dessa classe.
This message was edited 1 time. Last update was at 05/04/2011 13:08:37
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 05/04/2011 13:38:58
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|

Schuenemann wrote:
Isso só testa se em algum ponto da string tem isso.
"3aaa %e" passa nesse seu teste .
E no for use Character.isLetter() e demais métodos dessa classe.
Funcionou legal, obrigado
This message was edited 1 time. Last update was at 07/04/2011 11:26:05
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
|
|