Fixes #2626 and #2698 (strings size limits were hardcoded in sscanf call)

Pull #774 is closed and replaced by this now

- StringNotMatchingSetCapped is a better name
- function returns true if string was capped