Is there a way to parse these strings?
<p>If there is, I certainly don't see it. We are doing magnetic stripe reads off of driver's licenses. The data does not seem to be consistent. The standard that the driver's licenses should follow sets limits on the length that any one field can have. The part that I can't wrap my head around is how to parse this data.</p>

<p>For example, a field may allow 13 total characters but only 8 are used. In this case, there will always be a caret delimiter ending that portion of the string. However, and here is the tricky part, if a field is exactly 13 (of the 13 allowable), there is no end caret delimiter and no right padding. All of the data just runs together.</p>

<p>Here are two sample strings.</p>

<pre><code>%CAMISSION HILLSSMITH$JOHN$JIM$JR^1147 SOMESTREET^?
%CALOS ANGELES^DOE$JOHN$CARL^14324 MAIN ST APT 5^?
</code></pre>

<p>Using PHP, how might I do this? I'd truly appreciate a hand on this. I'm really stumped.</p>
