Tyepof regex

Tiberiu Gal galtiberiu at gmail.com
Mon Jan 13 13:00:10 PST 2014


On Monday, 13 January 2014 at 20:53:55 UTC, Tiberiu Gal wrote:
> what is the type returned by regex function?
> I want to store a regex member because I need to reuse it 
> multiple times.
> Can this be done?
>
>
> class A {
>
>   protected SomeTypeName regexPattern;
>
>
>  void load() {
>       string str;
>       // obtain a regex pattern and store it as str.
>       regexPattern = regex( str );
>   }
>
>   bool matches() {
>     // use regexPattern
>  }
>
> }


It's Regex!char

class A {
    protected Regex!char regexPattern;

...


More information about the Digitalmars-d-learn mailing list