# Path: talon/utils.py
# def get_delimiter(msg_body):
#     delimiter = RE_DELIMITER.search(msg_body)
#     if delimiter:
#         delimiter = delimiter.group()
#     else:
#         delimiter = '\n'
# 
#     return delimiter


import logging
import regex as re
from talon.signature.constants import (SIGNATURE_MAX_LINES,
                                       TOO_LONG_SIGNATURE_LINE)
from talon.utils import get_delimiter
from __future__ import absolute_import




log = logging.getLogger(__name__)

# regex to fetch signature based on common signature words
RE_SIGNATURE = re.compile(r'''
               (
                   (?:
                       ^[\s]*--*[\s]*[a-z \.]*$
                       |
                       ^thanks[\s,!]*$
                       |
                       ^regards[\s,!]*$
                       |
                       ^cheers[\s,!]*$
                       |
                       ^best[ a-z]*[\s,!]*$
                   )
                   .*
               )
               ''', re.I | re.X | re.M | re.S)

# signatures appended by phone email clients
RE_PHONE_SIGNATURE = re.compile(r'''
               (
                   (?:

# Path: talon/utils.py
# def get_delimiter(msg_body):
#     delimiter = RE_DELIMITER.search(msg_body)
#     if delimiter:
#         delimiter = delimiter.group()
#     else:
#         delimiter = '\n'
# 
#     return delimiter


# Path: talon/signature/bruteforce.py
import logging
import regex as re
from talon.signature.constants import (SIGNATURE_MAX_LINES,
                                       TOO_LONG_SIGNATURE_LINE)
from talon.utils import get_delimiter

from __future__ import absolute_import




log = logging.getLogger(__name__)

# regex to fetch signature based on common signature words
RE_SIGNATURE = re.compile(r'''
               (
                   (?:
                       ^[\s]*--*[\s]*[a-z \.]*$
                       |
                       ^thanks[\s,!]*$
                       |
                       ^regards[\s,!]*$
                       |
                       ^cheers[\s,!]*$
                       |
                       ^best[ a-z]*[\s,!]*$
                   )
                   .*
               )
               ''', re.I | re.X | re.M | re.S)

# signatures appended by phone email clients
RE_PHONE_SIGNATURE = re.compile(r'''
               (
                   (?:

                       ^sent[ ]{1}from[ ]{1}my[\s,!\w]*$