Closed (fixed)
Project:
Custom username validation
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Apr 2009 at 08:18 UTC
Updated:
6 Apr 2009 at 16:19 UTC
hi there. excellent module. but i can't find my way through pregmatch... sorry. can you help me?
i need to check the username for this pattern: say a user's name is Thomas Musterman (i am german too ;) ) i want it to check the username for
t.musterman
(it does not have to check for the real name but just for the pattern "oneLetter dot moreLetters")
thanks!
Comments
Comment #1
Schneck commentedhi there,
try [a-zA-Z]\.([a-zA-Z]+)
there are many regext testers out there, like http://www.fileformat.info/tool/regex.htm
bye
stefan
Comment #2
drupalok commentedthanks for the quick reply.
[a-zA-Z]\.([a-zA-Z]+) works in the regext test-link you sent me. but it does not work in drupal. (i just put it in the field like that... is that correct?)
it says "Username format is invalid" even if i put "t.musterman"
thank you very much!
Comment #3
Schneck commentedok, this one should work also in preg_match():
/^[a-zA-Z]\.([a-zA-Z]+)$/
For learning regex, i recommend this (german): http://www.amazon.de/Regul%C3%A4re-Ausdr%C3%BCcke-Jeffrey-E-Friedl/dp/38...
bye,
stefan
Comment #4
drupalok commentedthank you very much! this works like charm. i promise to learn pregmatch in the next weeks! :)