Newbie: Check first two non-whitespace characters

otaksoftspamtrap at gmail.com otaksoftspamtrap at gmail.com
Thu Dec 31 13:18:52 EST 2015


I need to check a string over which I have no control for the first 2 non-white space characters (which should be '[{').

The string would ideally be: '[{...' but could also be something like 
'  [  {  ....'.

Best to use re and how? Something else?



More information about the Python-list mailing list