(?:^`{3})(?:(.*$\n)?((?:.|\n)*?))(?:`{3}$)
Last active
November 25, 2019 11:51
-
-
Save igrek8/583296f7d77b65dba601fc39b560e923 to your computer and use it in GitHub Desktop.
match markdown code block
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The code in blocks will be matched | |
```js | |
var arr = [1, 2, 3]; | |
console.log(1, 2, 3); | |
``` | |
Unknown block | |
``` | |
#include <iostream> | |
#include <string> | |
struct A { | |
int val; | |
void print() { | |
std::cout << this - > val << std::endl; | |
} | |
}; | |
int main() { | |
A * a = new A(); | |
( * a).val = 100; | |
} | |
``` | |
```html | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
</body> | |
</html> | |
``` | |
And so on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment