Why does "*" cause my tiny regextester program to crash?

Alex Folland lexlexlex at gmail.com
Mon Jan 31 13:08:56 PST 2011


On 2011-01-31 15:43, Dmitry Olshansky wrote:
> On 31.01.2011 4:57, Alex Folland wrote:
>> I wrote this little program to test for regular expression matches. I
>> compiled it with in Windows with DMD 2.051 through Visual Studio 2010
>> with Visual D. It crashes if regexbuf is just the single character,
>> "*". Why? Shouldn't it match the entire string?
>>
>> Visual Studio's debug output is this:
>>
>> First-chance exception at 0x76fde124 in regextester.exe: 0xE0440001:
>> 0xe0440001.
>> The program '[5492] regextester.exe: Native' has exited with code 1
>> (0x1).
> To shed some light on this output.
> After using Visual D quite a lot I can tell you that this output
> *doesn't* mean the program crushed (in terms of segfault etc.). All it
> means is that there is uncaught exception, which is quite reasonable.
> Regexp parsing function throws when it detects wrong pattern. In
> general, when you are uncertain on what the **uk is going on I suggest
> to wrap suspicious code with :
> try{
> ... //code
> }catch(Exception e){
> writeln(e);
> }
> to see what's the errors are.

Ty.  Did that.  My updated code is here: 
http://lex.clansfx.co.uk/projects/regextester.d


More information about the Digitalmars-d-learn mailing list