Peter Otten wrote:
> Matt wrote:
>
>> What is easiest way to determine if a string ONLY contains a-z upper
>> or lowercase. I also want to allow the "-" and "_" symbols. No
>> spaces or anything else.
>
> If you don't know regular expressions here's a method where not much can
> go wrong:
...
On 06/13/2017 03:34 PM, Matt wrote:
> What is easiest way to determine if a string ONLY contains a-z upper
> or lowercase. I also want to allow the "-" and "_" symbols. No
> spaces or anything else.
>
I'm not sure it's the best way, but the following seems okay:
>>> s = 'hello_world'
>>> s.repl
Matt wrote:
> What is easiest way to determine if a string ONLY contains a-z upper
> or lowercase. I also want to allow the "-" and "_" symbols. No
> spaces or anything else.
If you don't know regular expressions here's a method where not much can go
wrong:
>>> import string
>>> acceptable =
What is easiest way to determine if a string ONLY contains a-z upper
or lowercase. I also want to allow the "-" and "_" symbols. No
spaces or anything else.
--
https://mail.python.org/mailman/listinfo/python-list