re = /transactionId=(?<transactionId>.*?)}.*ResourceId:\s(?<featureName>.*?),.*CPNYID_(?<companyId>\d+)_AID_(?<aPaymentId>\d+)/m
str = '2020-Apr-10 09:32:50.086 PDT [pool-4-thread-1] INFO com.adp.taxmod.lock.service.NTLockServiceImpl {createdDate=Fri Apr 10 09:32:49 PDT 2020, id=4-699211, transactionId=3746ddf0-e602-409b-831c-d0cd995c5595} - NTLockServiceImpl : acquireLock() - ResourceId: CREDIT_RECONCILE, ResourceType: {} CPNYID_25817065_AID_996'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html