QuestionQ116

VerifiedCustomer Service Management Integration

Which of the following regular expressions captures the host, port, and path from this MySQL connection string?

jdbc:mysql://localhost:3306/myDatabase?profileSQL=true

Question Image

Explanation

The host is localhost, the port is the numeric value 3306, and the path is myDatabase. A hostname capture such as ([\w\.]+), followed by a digit-only port capture ([\d]+) and a path capture ([\w]+), matches those three components in order. An IPv4-specific pattern does not apply to localhost, and a one-character hostname capture cannot match the full host name.

Community Discussion

No comments yet. Be the first to start the discussion!