1 /**************************************************************************
2 ** (c) Copyright 2001, Andromeda Technology & Automation
3 ***************************************************************************
4 ** MODULE INFORMATION *
5 ***********************
6 ** FILE NAME : regex.cpp
7 ** SYSTEM NAME : Andromeda X-Windows Encapsulation
8 ** VERSION NUMBER : $Revision: 1.1 $
10 ** DESCRIPTION : regex class implementation.
15 ***************************************************************************
16 ** ADMINISTRATIVE INFORMATION *
17 ********************************
18 ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
19 ** CREATION DATE : Feb 23, 2001
20 ** LAST UPDATE : Feb 23, 2001
22 **************************************************************************/
24 /*****************************
26 Revision 1.1 2002-07-25 08:01:27 arjen
27 First checkin, AXE release 0.2
29 *****************************/
31 static const char RCSID[] = "$Id: regex.cpp,v 1.1 2002-07-25 08:01:27 arjen Exp $";
37 // Constructors and destructors for the regex class
39 regex::regex(const String ®)
41 regcomp (&expression, reg.p->s, REG_EXTENDED);
44 regex::regex(const char *reg)
46 regcomp (&expression, reg, REG_EXTENDED);
55 bool operator == (const String &s, const regex &r)
57 return regexec(&r.expression, s.p->s, 0, 0, 0) == 0;
59 bool operator == (const regex &r, const String &s)
61 return regexec(&r.expression, s.p->s, 0, 0, 0) == 0;