Write a method tweetSize that accepts a string and returns an integer.
Handles (@username) don’t count towards the total
Hashtags (#wow) don’t count towards the total
Punctuation doesn’t count towards the total
There’s a whitelist of valid handle/hashtag characters: a-z, A-Z, 0-9, _
A hashtag/handle will therefore be a # or @ character, followed by 1 or more characters from the whitelist
The hashtag/handle ends at the first non-whitelisted character
Punctuation is defined as:!"#$%&’()*+,-./:;<=>?@[]^_`{|}~
There’s a blacklist of characters that cannot come before a handle/hashtag
(i.e. if one of these characters is directly before a # or @, that # or @ does NOT signify the start of a handle/hashtag):
blacklist: a-z, A-Z, 0-9, _, &
ex: “some #body” (5 characters)
ex: “some#body” (#body is not a hashtag… 8 characters)
ex: “@some#body” (@some IS a handle, #body still not a hashtag… 4 characters)
ex: "@hhh @hhh " (1)