Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

regular expression "contains" another regular expression

Tags:

regex

Is there a way to test if a regular expression "contains" another regular expression?
For example:

RegEX1 = "a.*b";
RegEx2 = "a1.*b";

RegEX1 "contains" RegEX2.

As far as I know - this can't be done, am I wrong?


OK, joel.neely has shown that it can be done (haven't read it yet...) academically.

Can it be done in a programming language, say C# ?
How effective will that be? How long will it take to test 1000 pairs?
like image 319
Dror Avatar asked Jan 06 '09 13:01

Dror


1 Answers

Yes.

This paper contains a detailed discussion of the topic (see section 4.4).

like image 177
joel.neely Avatar answered Nov 11 '22 05:11

joel.neely