I was trying out some regular expressions shown in NLPclass using regextester website.I used the following string
When I used the regex
But when I put a space in front of the whole sentence( just before 'The'), the two words 'The' at the beginning and 'the' after comma got matched.
I cannot understand why the regex failed to do the match for 'The' at the start of sentence ,why do I have to introduce another character.
In the course video,Prof.J gets the correct results because there was a string in the previous line.If there wasn't,then 'The' at the beginning of the sentence won't match.
asked 10 Mar '12, 00:05
It's because you tell it to match a character before T. When it says don't match these characters it is actually saying 'match a character but not one of these,' hence putting a space in front means the condition is satisfied.
answered 10 Mar '12, 00:15