[{"data":1,"prerenderedAt":597,"buildId":598},["ShallowReactive",2],{"docs-navigation-en":3,"example-\u002Fexamples\u002Fextract-inquiry":30,"example-surround-\u002Fexamples\u002Fextract-inquiry":507,"examples-en":517},[4],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Docs","\u002Fdocs","docs",[9,13,17,21,25],{"title":10,"path":11,"stem":12},"Getting started","\u002Fdocs\u002Fgetting-started","docs\u002F1.getting-started",{"title":14,"path":15,"stem":16},"In the browser and with frameworks","\u002Fdocs\u002Fin-the-browser","docs\u002F2.in-the-browser",{"title":18,"path":19,"stem":20},"Input rules","\u002Fdocs\u002Finput-rules","docs\u002F3.input-rules",{"title":22,"path":23,"stem":24},"Compared with libphonenumber","\u002Fdocs\u002Flibphonenumber","docs\u002F4.libphonenumber",{"title":26,"path":27,"stem":28},"Data and sources","\u002Fdocs\u002Fdata-and-sources","docs\u002F5.data-and-sources",false,{"id":31,"title":32,"body":33,"category":487,"demo":498,"description":499,"extension":500,"meta":501,"navigation":125,"order":87,"path":502,"seo":503,"stem":504,"uses":505,"__hash__":506},"examples_en\u002Fexamples\u002Fextract-inquiry.md","Find numbers in a message",{"type":34,"value":35,"toc":494},"minimark",[36,41,53,66,70,479,482,490],[37,38,40],"h2",{"id":39},"how-it-works","How it works",[42,43,44,48,49,52],"p",{},[45,46,47],"code",{},"extract"," searches free text and returns one result per number, in the order found. Each result has the same fields as ",[45,50,51],{},"normalize",".",[54,55,56,60,63],"ul",{},[57,58,59],"li",{},"Any text may surround a number: Japanese words, punctuation, names, line breaks.",[57,61,62],{},"Digit strings that do not fit the numbering plan or the MIC tables, such as dates, are not returned. Other digit strings, such as order numbers, are returned when they have the length of a phone number and happen to fall in a valid block.",[57,64,65],{},"The same number written twice is returned twice. See the company page example to remove duplicates.",[37,67,69],{"id":68},"in-each-language","In each language",[71,72,73,211,311],"code-group",{},[74,75,81],"pre",{"className":76,"code":77,"filename":78,"language":79,"meta":80,"style":80},"language-js shiki shiki-themes material-theme-lighter github-light github-dark","import { extract } from \"@kurashina-design\u002Fjapan-phone\";\n\n\u002F\u002F A message from a contact form.\nconst message = \"お世話になっております。日中は090-1234-5678、夜は自宅の092-513-5612までご連絡ください。\";\n\nfor (const number of extract(message)) console.log(number.type, number.national);\n","Node.js","js","",[45,82,83,120,127,134,158,163],{"__ignoreMap":80},[84,85,88,92,96,100,103,106,110,114,117],"span",{"class":86,"line":87},"line",1,[84,89,91],{"class":90},"sVHd0","import",[84,93,95],{"class":94},"sP7_E"," {",[84,97,99],{"class":98},"su5hD"," extract",[84,101,102],{"class":94}," }",[84,104,105],{"class":90}," from",[84,107,109],{"class":108},"sjJ54"," \"",[84,111,113],{"class":112},"s_sjI","@kurashina-design\u002Fjapan-phone",[84,115,116],{"class":108},"\"",[84,118,119],{"class":94},";\n",[84,121,123],{"class":86,"line":122},2,[84,124,126],{"emptyLinePlaceholder":125},true,"\n",[84,128,130],{"class":86,"line":129},3,[84,131,133],{"class":132},"sutJx","\u002F\u002F A message from a contact form.\n",[84,135,137,141,145,149,151,154,156],{"class":86,"line":136},4,[84,138,140],{"class":139},"sbsja","const",[84,142,144],{"class":143},"s_hVV"," message",[84,146,148],{"class":147},"smGrS"," =",[84,150,109],{"class":108},[84,152,153],{"class":112},"お世話になっております。日中は090-1234-5678、夜は自宅の092-513-5612までご連絡ください。",[84,155,116],{"class":108},[84,157,119],{"class":94},[84,159,161],{"class":86,"line":160},5,[84,162,126],{"emptyLinePlaceholder":125},[84,164,166,169,172,174,177,180,183,186,188,191,194,196,199,202,204,206,209],{"class":86,"line":165},6,[84,167,168],{"class":90},"for",[84,170,171],{"class":98}," (",[84,173,140],{"class":139},[84,175,176],{"class":143}," number",[84,178,179],{"class":147}," of",[84,181,99],{"class":182},"sGLFI",[84,184,185],{"class":98},"(message)) console",[84,187,52],{"class":94},[84,189,190],{"class":182},"log",[84,192,193],{"class":98},"(number",[84,195,52],{"class":94},[84,197,198],{"class":98},"type",[84,200,201],{"class":94},",",[84,203,176],{"class":98},[84,205,52],{"class":94},[84,207,208],{"class":98},"national)",[84,210,119],{"class":94},[74,212,217],{"className":213,"code":214,"filename":215,"language":216,"meta":80,"style":80},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","from japan_phone import extract\n\n# A message from a contact form.\nmessage = \"お世話になっております。日中は090-1234-5678、夜は自宅の092-513-5612までご連絡ください。\"\n\nfor number in extract(message):\n    print(number.type, number.national)\n","Python","python",[45,218,219,232,236,241,256,260,282],{"__ignoreMap":80},[84,220,221,224,227,229],{"class":86,"line":87},[84,222,223],{"class":90},"from",[84,225,226],{"class":98}," japan_phone ",[84,228,91],{"class":90},[84,230,231],{"class":98}," extract\n",[84,233,234],{"class":86,"line":122},[84,235,126],{"emptyLinePlaceholder":125},[84,237,238],{"class":86,"line":129},[84,239,240],{"class":132},"# A message from a contact form.\n",[84,242,243,246,249,251,253],{"class":86,"line":136},[84,244,245],{"class":98},"message ",[84,247,248],{"class":147},"=",[84,250,109],{"class":108},[84,252,153],{"class":112},[84,254,255],{"class":108},"\"\n",[84,257,258],{"class":86,"line":160},[84,259,126],{"emptyLinePlaceholder":125},[84,261,262,264,267,270,273,276,279],{"class":86,"line":165},[84,263,168],{"class":90},[84,265,266],{"class":98}," number ",[84,268,269],{"class":90},"in",[84,271,99],{"class":272},"slqww",[84,274,275],{"class":94},"(",[84,277,278],{"class":272},"message",[84,280,281],{"class":94},"):\n",[84,283,285,289,291,294,296,299,301,303,305,308],{"class":86,"line":284},7,[84,286,288],{"class":287},"sptTA","    print",[84,290,275],{"class":94},[84,292,293],{"class":272},"number",[84,295,52],{"class":94},[84,297,198],{"class":298},"skxfh",[84,300,201],{"class":94},[84,302,176],{"class":272},[84,304,52],{"class":94},[84,306,307],{"class":298},"national",[84,309,310],{"class":94},")\n",[74,312,317],{"className":313,"code":314,"filename":315,"language":316,"meta":80,"style":80},"language-java shiki shiki-themes material-theme-lighter github-light github-dark","import jp.kurashina.japanphone.JapanPhoneNumber;\nimport jp.kurashina.japanphone.JapanPhone;\n\n\u002F\u002F A message from a contact form.\nString message = \"お世話になっております。日中は090-1234-5678、夜は自宅の092-513-5612までご連絡ください。\";\n\nfor (JapanPhoneNumber number : JapanPhone.extract(message)) {\n  System.out.println(number.getType() + \" \" + number.getNational());\n}\n","Java","java",[45,318,319,345,366,370,374,392,396,426,473],{"__ignoreMap":80},[84,320,321,324,328,330,333,335,338,340,343],{"class":86,"line":87},[84,322,91],{"class":323},"sw1J6",[84,325,327],{"class":326},"s_bVq"," jp",[84,329,52],{"class":94},[84,331,332],{"class":326},"kurashina",[84,334,52],{"class":94},[84,336,337],{"class":326},"japanphone",[84,339,52],{"class":94},[84,341,342],{"class":326},"JapanPhoneNumber",[84,344,119],{"class":94},[84,346,347,349,351,353,355,357,359,361,364],{"class":86,"line":122},[84,348,91],{"class":323},[84,350,327],{"class":326},[84,352,52],{"class":94},[84,354,332],{"class":326},[84,356,52],{"class":94},[84,358,337],{"class":326},[84,360,52],{"class":94},[84,362,363],{"class":326},"JapanPhone",[84,365,119],{"class":94},[84,367,368],{"class":86,"line":129},[84,369,126],{"emptyLinePlaceholder":125},[84,371,372],{"class":86,"line":136},[84,373,133],{"class":132},[84,375,376,379,382,384,386,388,390],{"class":86,"line":160},[84,377,378],{"class":326},"String",[84,380,381],{"class":98}," message ",[84,383,248],{"class":147},[84,385,109],{"class":108},[84,387,153],{"class":112},[84,389,116],{"class":108},[84,391,119],{"class":94},[84,393,394],{"class":86,"line":165},[84,395,126],{"emptyLinePlaceholder":125},[84,397,398,400,402,404,406,409,412,414,416,418,420,423],{"class":86,"line":284},[84,399,168],{"class":90},[84,401,171],{"class":94},[84,403,342],{"class":326},[84,405,266],{"class":98},[84,407,408],{"class":90},":",[84,410,411],{"class":98}," JapanPhone",[84,413,52],{"class":94},[84,415,47],{"class":182},[84,417,275],{"class":94},[84,419,278],{"class":98},[84,421,422],{"class":94},"))",[84,424,425],{"class":94}," {\n",[84,427,429,432,434,437,439,442,444,446,448,451,454,457,459,461,463,465,467,470],{"class":86,"line":428},8,[84,430,431],{"class":98},"  System",[84,433,52],{"class":94},[84,435,436],{"class":98},"out",[84,438,52],{"class":94},[84,440,441],{"class":182},"println",[84,443,275],{"class":94},[84,445,293],{"class":98},[84,447,52],{"class":94},[84,449,450],{"class":182},"getType",[84,452,453],{"class":94},"()",[84,455,456],{"class":147}," +",[84,458,109],{"class":108},[84,460,109],{"class":108},[84,462,456],{"class":147},[84,464,176],{"class":98},[84,466,52],{"class":94},[84,468,469],{"class":182},"getNational",[84,471,472],{"class":94},"());\n",[84,474,476],{"class":86,"line":475},9,[84,477,478],{"class":94},"}\n",[42,480,481],{},"Output:",[74,483,488],{"className":484,"code":486,"language":487,"meta":80},[485],"language-text","mobile 090-1234-5678\nfixed_line 092-513-5612\n","text",[45,489,486],{"__ignoreMap":80},[491,492,493],"style",{},"html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .slqww, html code.shiki .slqww{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .skxfh, html code.shiki .skxfh{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s_bVq, html code.shiki .s_bVq{--shiki-light:#9C3EDA;--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":80,"searchDepth":122,"depth":122,"links":495},[496,497],{"id":39,"depth":122,"text":40},{"id":68,"depth":122,"text":69},"extract-inquiry","Pick every phone number out of a message, in the order it appears.","md",{},"\u002Fexamples\u002Fextract-inquiry",{"title":32,"description":499},"examples\u002Fextract-inquiry",[47],"w_S5Hg9qSPcMOh-KAgVxfwQRnVoSOVHNYzJERDi9FSQ",[508,513],{"path":509,"title":510,"description":511,"category":512,"order":136},"\u002Fexamples\u002Ftel-link","Make tel: links","Link numbers in their international form, and keep domestic-only numbers dialable.","forms",{"path":514,"title":515,"description":516,"category":487,"order":122},"\u002Fexamples\u002Fbusiness-card","Read a business card in kanji digits","Find numbers written with 〇一二三, as on vertical business cards.",[518,524,530,536,540,542,545,552,559,565,571,577,583,591],{"path":519,"title":520,"description":521,"category":512,"order":87,"uses":522,"demo":523},"\u002Fexamples\u002Fvalidate-input","Validate a phone number field","Accept full-width input, reject numbers that do not exist, and save one notation.",[51],"validate-input",{"path":525,"title":526,"description":527,"category":512,"order":122,"uses":528,"demo":529},"\u002Fexamples\u002Fpaste-labels","Accept pasted labels and notes","Take the main number from lines like ",[51],"paste-labels",{"path":531,"title":532,"description":533,"category":512,"order":129,"uses":534,"demo":535},"\u002Fexamples\u002Fmobile-only","Accept mobile numbers only","Use the type to decide whether a number can receive SMS.",[51,198],"mobile-only",{"path":509,"title":510,"description":511,"category":512,"order":136,"uses":537,"demo":539},[51,538],"international","tel-link",{"path":502,"title":32,"description":499,"category":487,"order":87,"uses":541,"demo":498},[47],{"path":514,"title":515,"description":516,"category":487,"order":122,"uses":543,"demo":544},[47],"business-card",{"path":546,"title":547,"description":548,"category":487,"order":129,"uses":549,"demo":551},"\u002Fexamples\u002Fcompany-page","List the numbers on a company page","Find TEL and FAX numbers and drop duplicates written in other notations.",[47,550],"digits","company-page",{"path":553,"title":554,"description":555,"category":556,"order":87,"uses":557,"demo":558},"\u002Fexamples\u002Fdisplay-format","Store digits, show hyphens","Format stored digits with the groups from the numbering table.","data",[51,307],"display-format",{"path":560,"title":561,"description":562,"category":556,"order":122,"uses":563,"demo":564},"\u002Fexamples\u002Fdedupe","Find duplicates written differently","Group entries that are the same number in different notations.",[51],"dedupe",{"path":566,"title":567,"description":568,"category":556,"order":129,"uses":569,"demo":570},"\u002Fexamples\u002Fcsv-cleanup","Clean a CSV column","Rewrite a phone column in one notation and flag rows that need a person.",[51],"csv-cleanup",{"path":572,"title":573,"description":574,"category":556,"order":136,"uses":575,"demo":576},"\u002Fexamples\u002Ftype-stats","Count numbers by type","See how many entries are mobile, fixed-line, toll-free, or invalid.",[51,198],"type-stats",{"path":578,"title":579,"description":580,"category":556,"order":160,"uses":581,"demo":582},"\u002Fexamples\u002Fe164","Convert to E.164","Pass numbers to SMS gateways, CRMs, and libphonenumber in international form.",[51,538],"e164",{"path":584,"title":585,"description":586,"category":587,"order":87,"uses":588,"demo":590},"\u002Fexamples\u002Fplan-check","Reject numbers that cannot exist","Numbers missing from the numbering plan or the MIC tables are invalid.","rules",[589],"isValid","plan-check",{"path":592,"title":593,"description":594,"category":587,"order":122,"uses":595,"demo":596},"\u002Fexamples\u002Finternational-input","Read numbers written for abroad","Accept +81 notation, including the bracketed (0), for the types that can be dialed from abroad.",[51],"international-input",1796483607983,"73e0e014-4aa7-4f04-8db5-5f7391793162"]