Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Hi slm, Thank you for the response. Your solution makes sense and also works. Commented May 5, 2013 at 19:37
  • Yup, @Sukminder was a little quicker hitting the submit button, thanks for the question 8-). Commented May 5, 2013 at 19:38
  • 1
    Note that \s is a GNU extension (inspired by perl) and is short for the standard [[:space:]], not [[:blank:]], that is it includes all the horizontal and vertical spacing characters, not just tab and space. It is also locale dependant. Your solution would also fail to remove the second test3 in "x test3 test3 y" Commented May 5, 2013 at 20:07
  • @StephaneChazelas, thanks for the improvement. Question, is it better to adjust our answers in situations like this or leave them and let the comments pick up these nuances? You've corrected a couple of my answers, which I appreciate, since I'm learning like everyone else, but I wasn't sure what was the correct thing to do? Commented May 5, 2013 at 20:14
  • Up to you really. I'm not sure there's some consensus on that. You can always ask on meta. Nothing wrong in editing the answer to improve or point out the limitations even if you come to realise that through others' comments IMO. Commented May 5, 2013 at 20:27