回答編集履歴
1
chousei
test
CHANGED
@@ -4,8 +4,9 @@
|
|
4
4
|
{Name: `\n\t\t\t\t\t\t\n\t\t\t\t\t\tたちつてとなにぬねの\n\t\t\t\t\t\tはひふへほ\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tまみむめも\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t`},
|
5
5
|
{Name: `\t\t\t\t\t\t`},
|
6
6
|
{Name: `a\t\t\t\t\t\tb`},
|
7
|
+
{Name: `a\t\t\tb\t\t\tc`},
|
7
8
|
]
|
8
|
-
const reg=/(?<=\s+)\S+?(?=\s)/;
|
9
|
+
const reg=/(?<=^\s+)\S+?(?=\s)/;
|
9
10
|
const result=selectNames.map(x=>reg.test(x.Name)?x.Name.match(reg)[0]:null);
|
10
11
|
console.log(result);
|
11
12
|
```
|