In a typical use case, a user enters a 3 word address into a search box. It is desirable that the user can enter and search for both standard addresses and 3 word addresses.
HERE hosts APIs to process standard addresses and 3 word addresses. To determine which API to call on the client side, the system matches user input against a regular expression. This detects whether the input is a standard or 3 word address.
In the following tutorial, one box search is used in a navigation scenario.
One box search consists of three navigation stages as follows:
Regex detects a 3 word address pattern
Autosuggest provides location suggestions based on typed input
Convert the selected 3 word address to coordinates
Regex detects a 3 word address pattern
When the user starts typing in the search box Regex runs on the background looking for a 3 word address pattern. Search results from HERE’s autosuggest endpoint will be suggested as normal until the 3 word address pattern is recognised. The pattern is word.word.word or ///word.word.word