# -*- coding: utf-8 -*-
#
##################################################################################
#
# Copyright 2016 FĂ©lix Brezo and Yaiza Rubio (i3visio, contacto@i3visio.com)
#
# This program is part of OSRFramework. You can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##################################################################################
from osrframework.utils.regexp import RegexpObject
class DemoPattern(RegexpObject):
'''
<DemoPattern> class.
'''
def __init__(self):
'''
Constructor without parameters.
Most of the times, this will be the ONLY method needed to be overwritten.
:param name: string containing the name of the regular expression.
:param reg_exp: string containing the regular expresion.
'''
# This is the tag of the regexp
self.name = "i3visio.demo"
# This is the string containing the reg_exp to be seeked
self.reg_exp = ["[^a-zA-Z1-9]" + "[0-9]{4}-?[A-Z]{3}" +"[^a-zA-Z1-9]"]
def isValidExp(self, exp):
'''
Method to verify if a given expression is correct just in case the used regular expression needs additional processing to verify this fact.
This method will be overwritten when necessary.
:param exp: Expression to verify.
:return: True | False
'''
return True