Regular Expression Problem...

Jorge Godoy godoy at ieee.org
Wed Dec 1 07:28:35 EST 2004


andrea.gavana at agip.it writes:

> #CODE BEGIN
> import re
>
> mystring = "This Is An \$EXAMPLE\String;"
> regex = re.compile("[\$]+\S*",re.IGNORECASE)
> keys = regex.findall(mystring)
>
> #CODE END

regex = re.compile("[\$]+\w*",re.IGNORECASE)

>>> import re
>>>
>>> mystring = "This Is An \$EXAMPLE\String;"
>>> regex = re.compile("[\$]+\w*",re.IGNORECASE)
>>> keys = regex.findall(mystring)
>>> keys
['$EXAMPLE']
>>>     


Be seeing you,
-- 
Godoy.     <godoy at ieee.org>



More information about the Python-list mailing list