← Back to context

Comment by sunrunner

18 hours ago

I'm not sure if it's just the leading '+' or if there are other factors for phone number detection on iOS, but on mobile the line count changes are underlined and I can tap it to start a call, which, if it is because of the diff size, is something I find pretty amusing.

Apple has had a feature called Apple Data Detectors since the 90's that looks for different patterns in text and allows you to perform actions on them.

So if the text includes a phone number, email address, flight number, package tracking number, street address or other pattern in the data it is underlined and allows you to perform one or more actions.

The patterns it looks for and actions it takes are extensible by developers.

If you don't care for it, you can turn it off.

> +1009257 -4024

    +1 (009) 257-4024

I think it just lines up with the typical size of a phone number and the '-' is interpreted as a separator. Just a simple regex probably.

The leading “+” is not needed. Numbers with seven digits are automatically hyperlinked (possibly depends on locale).

123456

1234567

12345678

  • Interesting. Where I am, both six and eight digit phone numbers are valid, but seven digit ones are not, and yet that's the only one that gets linked for me. US assumptions bleeding through, I assume.

  • Interestingly, the entire line gets formatted once it reaches seven digits, +lines and -lines both, so I guess the -lines is just interpreted as a dash. But your eight digit string doesn't. Perhaps it's not interesting, though I've never really given it a second thought before.

    • There’s certainly some regex or similar involved that tries to recognize phone numbers, and then hyperlinks the whole thing. My point was that it’s not solely the plus sign that is triggering it.