The Developer's Library for D
About
Wiki
Forums
Source
Search
Contact
Ticket #1124
: sample.d
File sample.d, 346 bytes (added by jhouse, 6 months ago)
File demonstrating regex failure
Line
1
import
tango
.
text
.
Regex
;
2
3
void
main
(){
4
assert
(
"abcdef"
==
Regex
(
"\n"
).
replaceAll
(
"abc\ndef"
,
""
));
5
assert
(
"abcdef"
==
Regex
(
"\r\n"
).
replaceAll
(
"abc\r\ndef"
,
""
));
6
assert
(
"abcdef"
==
Regex
(
"\r?\n"
).
replaceAll
(
"abc\ndef"
,
""
));
7
assert
(
"abcdef"
==
Regex
(
"\r?\n"
).
replaceAll
(
"abc\r\ndef"
,
""
),
"Regex failed to detect dos style line endings"
);
8
}
Download in other formats:
Original Format
Roadmap
Timeline
Tickets
New Ticket
Help / Guide
About Trac
Login
|
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static
or
Dynamic