I want to split a string into [a-zA-Z]
and some Special characters that contain @
and #
symbol
messages = "I @split, in #words, and any other that does not matter Most special character (., & Gt;) "
Expected Result:
How can I get it into Python? How about: Pattern term matches any sequence of characters (here, more than the letters ['I', ' I ',' to ',' b ',' @split ',', ',' in ',' #words', ',', 'and', 'some', 'other', 'chees' ',' ',' ',' ',' ',' ',' ',' ',' 'Special' ',' character ',' (','. ',', ',' ',' ',' '' ' / Code >
re.findall (r " [A-za-z @ #] + | \ s ", message)
@ < / Code> and
#
), or any non-white space character.
Comments
Post a Comment