Pattern \\d+|\\b[a-zA-Z']+\\b fails to find the digits in input "testing, 1, 2 testing". The regex is correct as can be tested here https://regex101.com/r/griuTm/1.
Changing the pattern to \\b[0-9a-zA-Z']+\\b works, but it changes the intent because that makes input "123abc" would be valid. \\b[0-9]+\\b|\\b[a-zA-Z']+\\b works too.
Pattern
\\d+|\\b[a-zA-Z']+\\bfails to find the digits in input "testing, 1, 2 testing". The regex is correct as can be tested here https://regex101.com/r/griuTm/1.Changing the pattern to
\\b[0-9a-zA-Z']+\\bworks, but it changes the intent because that makes input "123abc" would be valid.\\b[0-9]+\\b|\\b[a-zA-Z']+\\bworks too.