回答編集履歴
2
もんだいがあったから
test
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
```javascript
|
2
2
|
const paragraph = 'あい**うえお**かきくけこ';
|
3
|
-
const regex = /
|
3
|
+
const regex = /\*\*([^\*]+)\*\*/g;
|
4
|
-
const
|
4
|
+
const found = paragraph.replaceAll(regex, "<em>$1</em>");
|
5
|
-
|
5
|
+
|
6
|
-
|
6
|
+
console.log(found);
|
7
7
|
}
|
8
8
|
```
|
9
9
|
生のテキストからhtmlの<>を抜き出す感じで作りました。
|
1
エンター間違って押しちゃった
test
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
```javascript
|
2
|
+
const paragraph = 'あい**うえお**かきくけこ';
|
2
3
|
const regex = /(\*\*)[^\*]+(\*\*)/g;
|
3
4
|
const markUps = paragraph.matchAll(regex);
|
4
5
|
for (const m of markUps) {
|
5
|
-
|
6
|
+
console.log(m);
|
6
7
|
}
|
7
8
|
```
|
9
|
+
生のテキストからhtmlの<>を抜き出す感じで作りました。
|