regex - Regular expressions for getting all kinds of tokens including hyphens -


i want split sentence words , special characters. using regular expression below:

@"((\b[^\s]+\b)((?<=\.\w).)?) 

but returns words , not special characters such space-separated hyphens or colons.

ideally, sentence:

"right now!" shouted, , hands fluttered in air - amid few cheers - 2 minutes.

i should get:

 right shouted , hands fluttered in air - amid few cheers - 2 minutes 

sounds this regex you're looking for:

@"\b\s?([a-za-z-]+)\s?\b" 

seems bit simple regex you've been trying though! there more perhaps?


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -