So we've got a tricky one here.
codevar a = "BEGIN:VCARD VERSION:2.1 FN:Chris Herold TEL;work:888-919-0919 EMAIL;INTERNET;work:msacl@gmail.com END:VCARD"
alert(value);
b = a.match(/FN:(.+?)TEL/)[1];
alert(b);
return b;/code
The code above will work fine with code var a /code explicitly defined.
The alert to test the content of value codealert(value);/code pops up an alert with the expected content from the barcode scan (which is identical to what is in var a).
The variable codeb/code returns the expected output for the match: "Chris Herold" when the match target is codea/code.
However, when I change the match target from codea/code to codevalue/code, as done below ... nothing works, except the initial alert outputing the content that is identical to the content of var a.
alert b ends up with no value, and hence no alert.
codevar a = "BEGIN:VCARD VERSION:2.1 FN:Chris Herold TEL;work:888-919-0919 EMAIL;INTERNET;work:msacl@gmail.com END:VCARD"
alert(value);
b = value.match(/FN:(.+?)TEL/)[1];
alert(b);
return b;/code
How can this be happening? There must be some way that I need to encase 'value' to have it render properly, perhaps because the content it contains has semicolons????