Where do you test syntax of D regexp online?
Suliman via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Mar 9 06:50:33 PST 2017
I wrote two regexp:
--------------------
auto inlineCodeBlock = regex("`(.*?)`"); // --> `(.*?)`
auto bigCodeBlock = regex("/`{3}[\\s\\S]*?`{3}/g"); // -->
`{3}[\s\S]*?`{3}
--------------------
First for for selection inline code block. Second for multi-line:
--------------------
#Header
my header text
##SubHeader
my sub header text `foo inline code`
```
void foo()
{
writeln("ppp");
}
```
###Sub3Header
my sub 3 text `bar inline code`
#Header2
my header2 text
--------------------
It's work fine in online editor https://regex101.com/r/EC5WRu/1
(sic! \\s\\S double escaped in D code).
But after compilation of code:
auto x = content.matchFirst(bigCodeBlock);
writeln(x);
print:
[]
[]
It's seems that D regexp work in another way. How can I test them?
More information about the Digitalmars-d-learn
mailing list