Is '@' a special character in regular expressions? I am asking
because I don't understand the following:
[color=blue][color=green][color=darkred]
>>> import re
>>> s = ' @'
>>> re.sub(r'\b@',' *',s)[/color][/color][/color]
' @'[color=blue][color=green][color=darkred]
>>> s = ' a'
>>> re.sub(r'\ba',' *',s)[/color][/color][/color]
' *'
Have googled atsign and regular expressions but have not found
anything useful. System is Win XP, Python 2.3.3. Any help would be
appreciated.
because I don't understand the following:
[color=blue][color=green][color=darkred]
>>> import re
>>> s = ' @'
>>> re.sub(r'\b@',' *',s)[/color][/color][/color]
' @'[color=blue][color=green][color=darkred]
>>> s = ' a'
>>> re.sub(r'\ba',' *',s)[/color][/color][/color]
' *'
Have googled atsign and regular expressions but have not found
anything useful. System is Win XP, Python 2.3.3. Any help would be
appreciated.
Comment