Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
|||
import std.stdio, std.regex;
|
||||
|
||||
string remove1LineComment(in string s, in string pat=";#") {
|
||||
const re = "([^" ~ pat ~ "]*)([" ~ pat ~ `])[^\n\r]*([\n\r]|$)`;
|
||||
return s.replace(regex(re, "gm"), "$1$3");
|
||||
}
|
||||
|
||||
void main() {
|
||||
const s = "apples, pears # and bananas
|
||||
apples, pears ; and bananas ";
|
||||
|
||||
writeln(s, "\n====>\n", s.remove1LineComment());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue