Move esacping closer to where it is relevant
Stop caring about word boundaries during ticket autocompletion

Rather than use \b to help split on what to search for, use a greedy
regex that matches as many space-separated ticket numbers as possible.
This solves problems with autocompleting "4.2.0", for instance.

Resolves issues #25755.
Abort if there is nothing to search for

It is now possible for $term to be empty -- for instance, when
autocompleting "1 2 3 ".  In such cases, don't search at all, merely
abort.
Merge branch '4.2/autocomplete-ticket' into 4.2-trunk