Determine if the given argument is a valid hexadecimal pattern to be used with L{pattern}. @type token: str @param token: String to parse. @rtype: bool @return: C{True} if it's a valid hexadecimal pattern, C{False} otherwise.
(token)
| 181 | |
| 182 | @staticmethod |
| 183 | def is_pattern(token): |
| 184 | """ |
| 185 | Determine if the given argument is a valid hexadecimal pattern to be |
| 186 | used with L{pattern}. |
| 187 | |
| 188 | @type token: str |
| 189 | @param token: String to parse. |
| 190 | |
| 191 | @rtype: bool |
| 192 | @return: |
| 193 | C{True} if it's a valid hexadecimal pattern, C{False} otherwise. |
| 194 | """ |
| 195 | return re.match(r"^(?:[\?A-Fa-f0-9][\?A-Fa-f0-9]\s*)+$", token) |
| 196 | |
| 197 | @classmethod |
| 198 | def integer_list_file(cls, filename): |