Word boundary \b is used where one word should be a word character and another one a non-word character.Regular Expression for negative number should be
--?\b\d+\b
check working DEMO
Word boundary \b is used where one word should be a word character and another one a non-word character.Regular Expression for negative number should be
--?\b\d+\b
check working DEMO