docs: def _compile_prefixes(self):
          '''
          Create a dict of all OS prefixes and their compiled regexs
          '''
          self.compiled_prefixes = {}
          for dev_os, os_config in self.config.items():
              if not os_config:
                  continue
              self.compiled_prefixes[dev_os] = []
              for prefix in os_config.get('prefixes', []):
                  values = prefix.get('values', {})
                  line = prefix.get('line', '')
                  if prefix.get('__python_fun__'):
                      self.compiled_prefixes[dev_os].append({
                          '__python_fun__': prefix['__python_fun__'],
                          '__python_mod__': prefix['__python_mod__']
                      })
                      continue  # if python profiler defined for this prefix,
                      # no need to go further, but jump to the next prefix
                  # Add 'pri' and 'message' to the line, and values
                  line = '{{pri}}{}{{message}}'.format(line)
                  # PRI https://tools.ietf.org/html/rfc5424#section-6.2.1
                  values['pri'] = r'\<(\d+)\>'
                  values['message'] = '(.*)'
                  # We will now figure out which position each value is in so we can use it with the match statement
                  position = {}
                  for key in values.keys():
                      position[line.find('{' + key + '}')] = key
                  sorted_position = {}
                  for i, elem in enumerate(sorted(position.items())):
                      sorted_position[elem[1]] = i + 1
                  # Escape the line, then remove the escape for the curly bracets so they can be used when formatting
                  escaped = re.escape(line).replace(r'\{', '{').replace(r'\}', '}')
                  # Replace a whitespace with \s+
                  escaped = escaped.replace(r'\ ', r'\s+')
                  self.compiled_prefixes[dev_os].append({
                      'prefix': re.compile(escaped.format(**values)),
                      'prefix_positions': sorted_position,
                      'raw_prefix': escaped.format(**values),
                      'values': values
                  })