If you want to test a your pattern (Bluetooth,MAP,FTP..) whether or not exist in a multiple string you could use this re.search, the return value will be a MatchObject when it find a match otherwise will be None
re.search('^(Bluetooth|MAP|FTP):.+$', s, re.IGNORECASE|re.M)
if you want to find all the lines match your pattern you could use
ret = re.findall('^((Bluetooth|MAP|FTP):.+$)', s, re.IGNORECASE|re.M)
or
re.finditer('^((Bluetooth|MAP|FTP):.+$)', s, re.IGNORECASE|re.M)
The difference is findall will return a list of tuple and the finditer will return a MatchObject foreach yeild.
Here is the test code for three of this method base on your request
>>> s = '\nBluetooth: Merging two BT process into one BT process to reduce memory. This patch enables BTC , MAP , FTP & SAP modules to run in com.android.bluetooth context.\nBluetooth: Merging two BT process into one BT process to reduce memory. This patch enables BTC , MAP , FTP & SAP modules to run in com.android.bluetooth context.\nBluetooth: Merging two BT process into one BT process to reduce memory. This patch enables BTC , MAP , FTP & SAP modules to run in com.android.bluetooth context.\n\nMerging two BT process into one BT process to reduce memory. This patch enables BTC , MAP , FTP & SAP modules to run in com.android.bluetooth context.\n'
>>> ret = re.search('^(Bluetooth|MAP|FTP):.+$', s, re.IGNORECASE|re.M)
>>> ret.groups()
('Bluetooth',)
>>> ret = re.findall('^((Bluetooth|MAP|FTP):.+$)', s, re.IGNORECASE|re.M)
>>> ret
[('Bluetooth: Merging two BT process into one BT process to reduce memory. This patch enables BTC , MAP , FTP & SAP modules to run in com.android.bluetooth context.', 'Bluetooth'), ('Bluetooth: Merging two BT process into one BT process to reduce memory. This patch enables BTC , MAP , FTP & SAP modules to run in com.android.bluetooth context.', 'Bluetooth'), ('Bluetooth: Merging two BT process into one BT process to reduce memory. This patch enables BTC , MAP , FTP & SAP modules to run in com.android.bluetooth context.', 'Bluetooth')]
>>> for m in re.finditer('^((Bluetooth|MAP|FTP):.+$)', s, re.IGNORECASE|re.M):
... if m:
... print(m.group())
...
Bluetooth: Merging two BT process into one BT process to reduce memory. This patch enables BTC , MAP , FTP & SAP modules to run in com.android.bluetooth context.
Bluetooth: Merging two BT process into one BT process to reduce memory. This patch enables BTC , MAP , FTP & SAP modules to run in com.android.bluetooth context.
Bluetooth: Merging two BT process into one BT process to reduce memory. This patch enables BTC , MAP , FTP & SAP modules to run in com.android.bluetooth context.
>>> for m in re.finditer('^((Bluetooth|MAP|FTP):.+$)', s, re.IGNORECASE|re.M):
... if m:
... print(m.groups())
...
('Bluetooth: Merging two BT process into one BT process to reduce memory. This patch enables BTC , MAP , FTP & SAP modules to run in com.android.bluetooth context.', 'Bluetooth')
('Bluetooth: Merging two BT process into one BT process to reduce memory. This patch enables BTC , MAP , FTP & SAP modules to run in com.android.bluetooth context.', 'Bluetooth')
('Bluetooth: Merging two BT process into one BT process to reduce memory. This patch enables BTC , MAP , FTP & SAP modules to run in com.android.bluetooth context.', 'Bluetooth')