Splitting String in regex with - as one word
问题 I am trying to split a sentence with 32 chars in each group of regex. The sentence is split after the complete word if 32nd character is a letter in the word. When my input is a sentence which has "-" it splits that word too. This is the regex I am using (\b.{1,32}\b\W?) Input string: Half Bone-in Spiral int with dark Packd Smithfield Half Bone-in Spiral Ham with Glaze Pack resulting groups: Half Bone-in Spiral int with dark Packd Smithfield Half Bone- in Spiral Ham with Glaze Pack In above