から特定の最後の言葉を引くと、私はを通じてIループ会社名を持ち、マップ
dataset.nodes.forEach(d => {d.name = d.fullName.split(' ').map(w => w[0]).join('')});
ロイズ・バンキング・グループPLCは、企業の一例だろうと私はかどうかを確認したい以下のコードを使用して略語を作成します最後の単語はPLC/plc/plcですsplit
後
var dataset = {"nodes":[{"fullName":"Anglo American plc"},{"fullName":"Whitbread PLC"}],"edges":[{"source":0,"target":29,"officers":["MEDORI, Rene"]},{"source":0,"target":30,"officers":["GROTE, Byron Elmer"]},{"source":0,"target":31,"officers":["GROTE, Byron Elmer"]},{"source":1,"target":13,"officers":["BASON, John George"]},{"source":1,"target":18,"officers":["HAUSER, Wolfhart Gunnar, Dr"]},{"source":1,"target":27,"officers":["SINCLAIR, Charles James Francis"]},{"source":2,"target":14,"officers":["COURT, Annette Elizabeth"]},{"source":3,"target":11,"officers":["GREEN, Andrew James"]},{"source":3,"target":12,"officers":["PUSEY, Stephen Charles"]},{"source":3,"target":15,"officers":["KENNEDY, Christopher John"]},{"source":3,"target":24,"officers":["CHAMBERS, Stuart John"]},{"source":3,"target":31,"officers":["CHAMBERS, Stuart John"]},{"source":3,"target":32,"officers":["KENNEDY, Christopher John"]},{"source":4,"target":8,"officers":["BARKER, Glyn"]},{"source":4,"target":12,"officers":["WHEWAY, Jonathan Scott"]}]};
いくつかの例を示しますか? –
_RegExp_、 '/\W(plc|p\.l\.c\.)/i.test('Lloyds PLC ')のジョブのように見えます。 //真 '、' /\W(plc|p\.l\.c\.)/i.test('Lloyds '); // false' –
@ ZohaibIjaz ive added example ...、Paul S.正規表現の仕事であることを理解していますが、私があなたに示したコードに追加する方法がわかりません – Higeath