def find_one(cls, pattern, string, flags=0):
        """JS-like match object. Use index number to get groups, if not match or no group, will return ''.

        Basic Usage::

            >>> from torequests.utils import find_one
            >>> string = "abcd"
            >>> find_one("a.*", string)
            <torequests.utils.RegMatch object at 0x0705F1D0>
            >>> find_one("a.*", string)[0]
            'abcd'
            >>> find_one("a.*", string)[1]
            ''
            >>> find_one("a(.)", string)[0]
            'ab'
            >>> find_one("a(.)", string)[1]
            'b'
            >>> find_one("a(.)", string)[2] or "default"
            'default'
            >>> import re
            >>> item = find_one("a(B)(C)", string, flags=re.I | re.S)
            >>> item
            <torequests.utils.RegMatch object at 0x0705F1D0>
            >>> item[0]
            'abc'
            >>> item[1]
            'b'
            >>> item[2]
            'c'
            >>> item[3]
            ''
            >>> # import re
            >>> # re.findone = find_one
            >>> register_re_findone()
            >>> re.findone('a(b)', 'abcd')[1] or 'default'
            'b'

        """
        item = re.search(pattern, string, flags=flags)
        return cls(item)
def find_one ( cls , pattern , string , flags = 0 ) : item = re . search ( pattern , string , flags = flags ) return cls ( item )
JS-like match object. Use index number to get groups, if not match or no group, will return ''.

        Basic Usage::

            >>> from torequests.utils import find_one
            >>> string = "abcd"
            >>> find_one("a.*", string)
            <torequests.utils.RegMatch object at 0x0705F1D0>
            >>> find_one("a.*", string)[0]
            'abcd'
            >>> find_one("a.*", string)[1]
            ''
            >>> find_one("a(.)", string)[0]
            'ab'
            >>> find_one("a(.)", string)[1]
            'b'
            >>> find_one("a(.)", string)[2] or "default"
            'default'
            >>> import re
            >>> item = find_one("a(B)(C)", string, flags=re.I | re.S)
            >>> item
            <torequests.utils.RegMatch object at 0x0705F1D0>
            >>> item[0]
            'abc'
            >>> item[1]
            'b'
            >>> item[2]
            'c'
            >>> item[3]
            ''
            >>> # import re
            >>> # re.findone = find_one
            >>> register_re_findone()
            >>> re.findone('a(b)', 'abcd')[1] or 'default'
            'b'