Skip to content

Instantly share code, notes, and snippets.

@oki
Created May 15, 2009 09:19
Show Gist options
  • Select an option

  • Save oki/112134 to your computer and use it in GitHub Desktop.

Select an option

Save oki/112134 to your computer and use it in GitHub Desktop.
my $str = "UPDATE cd_firstdata_auth SET \
fda_invoice_id='74937', \
fda_invoice_name='plg_invoice', \
fda_auth_no='G2 C3LS', \
fda_term_no='0', \
fda_modified=NOW(), \
fda_modified_by='6', \
fda_type='M' WHERE \
fda_id = '1' AND (\
fda_auth_no != 'G2C3LS' || \
fda_term_no != '0')";
while ($str =~ m/(\w+)\s?=\s?'?(.*?)[',]/g) {
print "$1=$2\n";
}
# fda_invoice_id=74937
# fda_invoice_name=plg_invoice
# fda_auth_no=G2 C3LS
# fda_term_no=0
# fda_modified=NOW()
# fda_modified_by=6
# fda_type=M
# fda_id=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment