code how to cut a string with regex (the neat way) It is fairy a common task to cut a string - ie when a teaser text should not be longer than n characters. A lot of people use substring() or substr(), depending on their favourite language. However with regex it is really easy and