re = /{\'?\w+\'?\:? ?\'?\w+\/?\w+ ?\-? ?\w+ ?\w+ ?\w+\'?(\,?) ?\'?\w+\'?\:? ?\'?(\d+)?\-?(\d+)?\-?([a-z0-9A-Z\/:\']+)?(\,?) ?\,?\'?\w+\'?\:? ?\'?(\w+)?\'?(\,?) ?\'?(\w+)?\'?\:? ?\'?([a-zA-Z 0-9,\\\.\-\;\(\)\$\:\/]+)?\'?}/m
str = '{\'action\': \'Inspection/Audit - No Deficiencies Noted\', \'date\': \'2004-03-15T00:00:00Z\', \'flag\': \'Green\'}
{\'flag\': \'Unspecified\'}
{\'flag\': \'Unspecified\'}
{\'flag\': \'Unspecified\'}
{\'flag\': \'Unspecified\'}
{\'flag\': \'Unspecified\'}
{\'action\': \'Inspection/Audit- Voluntary Action Indicated\', \'date\': \'2003-03-04T00:00:00Z\', \'flag\': \'Yellow\', \'details\': \'\'}
{\'action\': \'Other\', \'date\': \'2017-06-20T00:00:00Z\', \'flag\': \'Red\', \'details\': \'June 20, 2017\\n\\nCase No. 18-079\\n\\nIt is admitted by Dr. Thorneycroft that, on November 30, 2016, upon the stipulation of the parties, the Commission issued a Consent Order finding that Dr. Thorneycroft violated Commission Rule 545-X-4-.06(6) by failing to obtain by December 31, 2015, the 50 credits of Category 1 CME required by a Consent Order of the Commision entered on January 28, 2015. Dr. Thorneycroft was reprimanded, assessed a $5,000 administrative fine (payable in annual installments), and required to complete, before June 30, 2017, 25 credits of Category 1 CME in addition to earning the 25 credits of Category 1 CME which were necessary to receive his annual registration.\\n\\nDr. Thorneycroft admits that on or about July 26, 2017, pursuant to a request from the Board, he produced evidence of only twelve (12) valid credits earned during the period, November 30, 2016 through June 30, 2017. Dr. Thorneycroft did have sufficient credits necessary for his annual registration for 2017.\\n\\n...Based upon the foregoing findings of fact and conclusions of law, it is the ORDER of the Medical Licensure Commission:\\n\\n1. That the license to practice medicine of the Respondent, IAN HALL THORNEYCROFT, M.D., license certificate number MD.15135, be, and is hereby REPRIMANDED.\\n\\n\\n\\nhttps://abme.igovsolution.com/ABMEDOCS/2018/7/0322a952c6e6427ebddaef1288e84b60732018.pdf\'}
{\'action\': \'Inspection/Audit - No Deficiencies Noted\', \'date\': \'2001-02-22T00:00:00Z\', \'flag\': \'Green\'}
{\'flag\': \'Unspecified\'}
{\'flag\': \'Unspecified\'}
{\'flag\': \'Unspecified\'}
{\'action\': \'Inspection/Audit- Voluntary Action Indicated\', \'date\': \'2003-08-13T00:00:00Z\', \'flag\': \'Yellow\', \'details\': \'03-Inadequate informed consent form;\\r\\n06-Inadequate and inaccurate records;\\r\\n15-Failure to notify IRB of changes, failure to submit progress reports;\\r\\n16-Failure to report adverse drug reactions\'}
{\'flag\': \'Unspecified\'}
{\'action\': \'Inspection/Audit - No Deficiencies Noted\', \'date\': \'2010-06-16T00:00:00Z\', \'flag\': \'Green\', \'details\': \'\'}
{\'action\': \'Inspection/Audit - No Deficiencies Noted\', \'date\': \'2010-06-28T00:00:00Z\', \'flag\': \'Green\', \'details\': \'No deficiencies noted\'}
{\'action\': \'Inspection/Audit - No Deficiencies Noted\', \'date\': \'2005-12-13T00:00:00Z\', \'flag\': \'Green\'}
{\'action\': \'Inspection/Audit- Voluntary Action Indicated\', \'date\': \'2003-08-13T00:00:00Z\', \'flag\': \'Yellow\', \'details\': \'03-Inadequate informed consent form;\\r\\n06-Inadequate and inaccurate records;\\r\\n15-Failure to notify IRB of changes, failure to submit progress reports;\\r\\n16-Failure to report adverse drug reactions\'}
{\'action\': \'Inspection/Audit - No Deficiencies Noted\', \'date\': \'2005-12-13T00:00:00Z\', \'flag\': \'Green\'}
'
# 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