Regular matching
The following is the string
I am code
##javascript
#var a = 1;
console.log(a);
#javascript
##…
I am Chinese:
The weather is so good today
…
I am code
##javascript
#var b = 1;
console.log(b);
#javascript
# #…
Now we need to get all the content between ##javascript# and #javascript##. How should we write it? Include all spaces and newlines.
I tried [\s\S]*, but if there are multiple similar pieces of code (as shown above), it will directly match the last #javascript## and not recognize the ones in between. . I'm so helpless, please help. .
Halo, how can the segment editor use non-markdown mode. . . Turn all my code into styles
Regularly, you can use exec to extract multiple values, but there will be dirty data, so it is actually more convenient to use split