Hi,
I want to spilt a sentence but KEEP the points,questionmarks,spaces,...
Like so:
$sentence = "A simple sentence!";
@words = spilt(/???/,$sentence);
@words[0] should be 'A'
@words[1] should be ' '
@words[2] should be 'simple'
@words[3] should be ' '
@words[4] should be 'sentence'
@words[5] should be '!'
But I have no idea how the expression should be??
just the words is simple, but I want to keep the '!' !!!
the ' ' don't really matter, but could be usefull to me... Can anyone help?
Thanx ALOT !!
math
I want to spilt a sentence but KEEP the points,questionmarks,spaces,...
Like so:
$sentence = "A simple sentence!";
@words = spilt(/???/,$sentence);
@words[0] should be 'A'
@words[1] should be ' '
@words[2] should be 'simple'
@words[3] should be ' '
@words[4] should be 'sentence'
@words[5] should be '!'
But I have no idea how the expression should be??
just the words is simple, but I want to keep the '!' !!!
the ' ' don't really matter, but could be usefull to me... Can anyone help?
Thanx ALOT !!
math