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
Post a Comment