Regular expression allows us to identify patterns of data by using generic search patterns. For example, searching for all possible phone numbers of type XXX-XXX-XXXX appearing in a document can be easily accomplished by one regular expression. We are going to create a regular expression module that will run a set of default expressions or a user-supplied expression against the processed WAL data. The purpose of the default expressions will be to identify relevant forensic information such as URLs or personally identifiable information (PII).
While this is not a primer on regular expression by any means, we will briefly touch on the basics so we can understand its advantages and the regular expressions used in the code. In Python, we use the re
module to run regular expressions against strings. We must first compile the regular expression and then check if there are any matches in the string.
>>> import re >>> phone = '214-324-5555' >>...