I have 4 elements stored in an array, I want to get the integers only from the strings in which Approved key word is mentioned.
my_array = ['STK72184 4/28/2022 50 from Exchange Balance, 50 from Earning Balance & 10 from Bonus 25000 Regular 10/20/2023 Approved 4/28/2022',
'STK725721 4/27/2022 50 from Exchange Balance, 40 from Earning Balance & 10 from Bonus Balance 5000 Regular 10/19/2023 Closed 4/27/2022',
'STK725721 4/27/2022 50 from Exchange Balance, 40 from Earning Balance & 10 from Bonus Balance 15000 Regular 10/19/2023 Closed 4/27/2022',
'STK722222 4/26/2022 50 from Exchange Balance, 40 from Earning Balance & 10 from Bonus Balance 10000 Regular 10/18/2023 Approved 4/26/2022']
Till now I can only get the integers from the list by doing this:
import re
# Print integers
nums = [int(re.search(r'\d+000', s)[0]) for s in my_array]
print(nums)
# Printed output:
# [25000, 5000, 15000, 10000]
Expected output is:
[25000,10000]