I am trying to extract all the presence of 'and', 'a', 'the', 'an','& amp ;' from a block of text along with all the presence of digits.
I tried to create different regex for that purpose but fail to get the accurate result.
All the digits are extracted fine but I am unable to fetch all the aforementioned strings through regex.
My basic regex was
Pattern p = Pattern.compile("^[0-9]");
then I tried different combinations like
Pattern p = Pattern.compile("^[0-9](&)");
Pattern p = Pattern.compile("^[0-9]+[&]");
to get aforementioned strings but of no use.
Example of the text:
System requirements: iOS 6.0 and Android (varies) &
Version used in this guide: 2.2.4 (iPhone), 13.1.2 (Android)
Expected Result
6.0,and,&,2.2.4,13.1.2