DAR-2129: Changed regex pattern and move some logic to function
DAR-2129: Unit tests for changing local links to interwiki links