help with RegExp not matching [D1]

jicman cabrera_ at _wrc.xerox.com
Sun Nov 22 18:54:06 PST 2009


jicman Wrote:

> Greetings and salutations.
> 
> I am having trouble with this regular expression.  I tried a few things and nothing.  Any help will be greatly appreciated.  Here is the program...
> 
> import std.stdio;
> import std.regexp;
> 
> 
> void main()
> {
>   char[] l, s, s0, str0;
> 
>   s = ";p=SomeCompany;l=USA0300MS01-091110184958Z-3076Delivery:";
>   str0 = r"p=SomeCompany;l=[a-zA-Z0-9]+\-\d\d\d\d\d\d\d\d\d\d\d\dZ\-d\d\d\d";
>   str0 = r"\-\d\d\d\d\d\d\d\d\d\d\d\dZ\-d\d\d\d";
>   if (RegExp(str0).find(s) >= 0) // found ;p=XeroxCorp;l=USA0300MS01-091110184958Z-3076
>   {
>     writefln("Found it...");
>   }
>   else
>     writefln("Not found...");
> }
> 
> 18:16:05.94>build -I..;c:\D\dmd\import regexp1.d
> 
> 18:21:13.68>regexp1
> Not found...
> 
> thanks for the help.
> 
> josé

Does anybody hve any ideas?

thanks.


More information about the Digitalmars-d-learn mailing list