|
Hello,
I would like to validate my users, so they can only use a-z and - in their username.
validates_format_of :username, :with => /[a-z]/
However this rule also allows spaces ._@
Username should use only letters, numbers, spaces, and .-_@ please....
Started by atmorell on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
The [] may contain several "rules" so [a-z0-9] gives lowercase letters and numbers
the special character - must go at the start of the rule
Does
[-a-z0-9@_.]
give the effect you want?
You may need to say the whole string must match:
validates_format_... .
|
|
I'm making a code generation script for UN/LOCODE system and the database has unique 3 letter/number codes in every country. So for example the database contains "EE TLL", EE being the country (Estonia) and TLL the unique code inside Estonia, "AR TLL"...
Started by Solenoid on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
I would for option....
The conversion should be trivial because you have a total of 34 (A-Z, 2-9) letters .
To make it more efficient, you can store a number representing each 3-letter code .
I will go with number 2, it is simple and 40000 is not a big number .
|
|
I'm interested in generating short codes (up to 6 characters) which are unambiguous for human readability:
i.e.: 2Z8B5S would be a very bad code because B looks a lot like 8 and 2 looks a lot like Z, etc.
A good code would be something like: AE37HT, say...
Started by Cade Roux on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Look for other letter/number combinations font, I think you could pick any letter/number combination and have it be understandable clearly.
With separate 0/O looks - those definitely mess people up .
|
Ask your Facebook Friends
|
How can I create a regex expression which will match only letters and numbers, and one space between each word?
Good Examples:
Amazing Hello Beautiful World I am 13 years old
Bad Examples:
Hello world I am 13 years old. I am Chuck Norris
Started by Alon on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
This would match a word
'[a-zA-Z0-9]+\ ?'
([a-zA-Z0-9]+ ?)+?
Most regex implementations support named character classes:
^[[:alnum:]]+( [[:alnum:]]+)*$
You could be clever though a little less clear and simplify this to:
^([[:alnum:]]+ ?)*$
FYI, the... .
|
|
Enhancing letters/numbers in photograph. Please Help! Hello,
I am a train buff and I caught several pictures of a piece of maintenance equipment (vacuum car) using both continuous mode and in other modes on my Nikon S8100. The thing is, the number's last...
Started by njunderground on
, 15 posts
by 4 people.
Answer Snippets (Read the full thread at thephotoforum):
My toys: Nikon D60 & gripped D7000: Nikkor 10.5 fisheye, 10-24, 18-105, 70-300: Tokina 500: Sigma 600: Celestron 2000 : auto macro tube set: SB600 : Manfrotto 055XB/390RC2 & 560B - 1: Gossen Starlite: Easy-Up AP1500: 40' ... .
How about posting the shot?.
|
|
I know how to do this if I iterate through all of the characters in the string but I am looking for a more elegant method.
Thanks
Started by Ethan Post on
, 9 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
If re.match("^[A-Za-z0-9_-]*$", my_little_string): # do something here
pat = re.compile ('[^\w-]') def onlyallowed(... .
Use a regex and see if it matches!
([a-z][A-Z][0-9]\_\-)*
A regular expression will do the trick with very little code:
import re .. .
|
|
I recently brought the Trend Letter, Number template set from Axeminster, I struggle clamping the templates when I’m routing in the middle of a board, Has anyone used this product before and would like to share any useful tips, jigs or any information...
Started by CHJ on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at ukworkshop):
Cheers, Paul Hi captain,
I have used the template set and put... .
I use double sided sticky tape.
Clamp, screw or wedge the work to the template frame .
I haven't used the Template Set but a suggestion might be to make a frame for the templates to fit into .
|
|
I have received letter number 2 from civil enforcement Ltd today. Well I say I have. By this I mean my employer as it was my company car that i got "done" in for parking over the allowed time limit. Now my employer knows its a farce but isn't too happy...
Started by Jamie_ Stevenson on
, 4 posts
by 3 people.
Answer Snippets (Read the full thread at consumeractiongroup):
But to hopefully get them off the Employer's back they can send a letter along the lines -
"We are the Registered Keeper of the vehicle and as such we are under no obligation to provide any details other... .
It is preferable not to admit who was the Driver .
|
|
Hi, this is probably a silly question but just bought a 2010 RZ4 and want to find the right registration decals that look best with Tige graphics. Does anybody have a recommendation of what to buy and where? Know I can pick the "standard" ones up but ...
Started by Eastern shore wake on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at tigeowners):
If you know someone with a vinyl....
Most people always just buy the individual letters in a standard Arial or Tahoma font and put them on one by one .
Where I'm at you can pick any font you like as long as they are 3 inches tall and readable from a distance .
|
|
Hello all
I would like some of the older style number plates with the bigger lettering on them. Does anyone know where I can get some made up?
Thanks, Dave.
Started by Daviewonder on
, 9 posts
by 5 people.
Answer Snippets (Read the full thread at 205gtidrivers):
The issue is that new number plates for cars must be made to the current regulations, with 50mm wide... .
I was after some of these too and am currently in comms with a couple of people to do the older font and including original dealership details and logos .
|