Mozilla/2.0 (Linux; Android 2.0; KK; SAMSUNG SM-G900H Build/LRX21T) AppleWebKit
Must be extracted SAMSUNG SM-G900H Build/LRX21T.
Mozilla/5.0 (Linux; Android 5.0; SAMSUNG SM-G900H Build/LRX21T) AppleWebKit
Must be extracted SAMSUNG SM-G900H Build/LRX21T.
Mozilla/5.0 (Linux; Android 5.1; XT1032 Build/LPBS23.13-56-2; wv) AppleWebKit
It is required to extract XT1032 Build/LPBS23.13-56-2.
The logic is this:
1. Take first [(.....)]
2. Take text after last semicolon [;]
3. Or take text after last semicolon [;] and before [; wv]
What I have now:
.*?\(.*;(?<model>.*?)(; wv)?\)
But this works for the first 2 examples, and returns for the third example wv.
source
share