Want to get from the string SoutContracts[work_address]
the number 0.
The task is simple. There is a field
<input type="text" id="soutcontracts-work_address_ar-0" class="form-control" name="SoutContracts[work_address]" value="some address">
you need to clone in compliance with the order of the index of the attribute name
input s can be a lot and the last index is not known.