Re: Regex match in for loop

2014-07-15 Thread Brad Anderson via Digitalmars-d-learn
On Tuesday, 15 July 2014 at 20:18:58 UTC, seany wrote: Consider this: import std.stdio, std.regex, std.array, std.algorithms ; void main(string args[]) { string[] greetings = ["hello", "hallo", "hoi", "salut"]; regex r = regex("hello", "g"); for(short i = 0; i < greetings.count(); i++) {

Re: Regex match in for loop

2014-07-15 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jul 15, 2014 at 08:18:55PM +, seany via Digitalmars-d-learn wrote: > Consider this: > > import std.stdio, std.regex, std.array, std.algorithms ; > > void main(string args[]) > { > > string[] greetings = ["hello", "hallo", "hoi", "salut"]; > > regex r = regex("hello", "g"); > > for(

Regex match in for loop

2014-07-15 Thread seany via Digitalmars-d-learn
Consider this: import std.stdio, std.regex, std.array, std.algorithms ; void main(string args[]) { string[] greetings = ["hello", "hallo", "hoi", "salut"]; regex r = regex("hello", "g"); for(short i = 0; i < greetings.count(); i++) { auto m = match(greetings[i], r); } } To the best of my