Improve regular expression (Issue 7230)