Finding numbers in text

Read a business card in kanji digits

extract
Find numbers written with 〇一二三, as on vertical business cards.
Try it
03-5253-8111+81352538111
090-1234-5678+819012345678

How it works

Vertical text writes numbers with kanji digits: 〇三(五二五三)八一一一. extract reads the single-digit kanji 〇一二三四五六七八九, full-width digits, and full-width brackets and dashes.

Written numbers with place values, such as 三千 or 十, are not phone numbers and are not read.

libphonenumber does not read kanji digits; this is one of the differences.

In each language

import { extract } from "@kurashina-design/japan-phone";

// Text read from a business card printed in vertical writing, with kanji digits.
const card = `株式会社サンプル 営業部
電話 〇三(五二五三)八一一一
携帯 〇九〇-一二三四-五六七八`;

for (const number of extract(card)) console.log(number.national, number.international);

Output:

03-5253-8111 +81352538111
090-1234-5678 +819012345678