Perfect Peter, much appreciated.  I&#39;ll give it a go, and see how it goes.  Its nice the API is so flexible.  <div><br></div><div>~A<span></span><br><br>On Tuesday, July 31, 2012, Peter von Kaehne  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
&gt; Von: Andrew Thule &lt;<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;thulester@gmail.com&#39;)">thulester@gmail.com</a>&gt;<br>
<br>
&gt;  This one is shorter<br>
&gt; using awk not php slightly more elegant and handles books of the form<br>
&gt; 1 John and 1John:<br>
<br>
You did not tell what the ultimate purpose for your conversion is, but assuming you want to create OSIS references, you might want to investigate using the sword API for doing the job. That is one of the things it is excellent at.<br>

<br>
I created a a while ago a Perl script which translates following<br>
<br>
&lt;reference&gt;A_long_and_complicated_series_of_references_in_any_supported_language&lt;reference&gt;<br>
<br>
into<br>
<br>
&lt;note type=&quot;crossReference&quot;..&gt;&lt;reference osisRef=...&gt;....<br>
<br>
Where the &quot;long and complicated series...&quot; is broken up, translated into OSIS refs and put together into a crossreference note, with the original text as free text.<br>
<br>
The heavy lifting is done by Sword and relies on the sword Perl bindings<br>
<br>
It is in sword-tools/modules/crossreferences/<a href="http://xreffix.pl" target="_blank">xreffix.pl</a><br>
<br>
Unfortunately the PHP bindings are in a poor state AFAIK, but maybe you can reactivate them and use them for your purposes<br>
<br>
Yours<br>
<br>
Peter<br>
<br>
_______________________________________________<br>
sword-devel mailing list: <a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;sword-devel@crosswire.org&#39;)">sword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br>
</blockquote></div>