jquery sortable with regexp
- by Chris Lively
I am trying to figure out the right regexp to match on list item id's.
For example:
<ul id="MyList" class="connectedSortable">
<li id="id=1-32">Item 1</li>
<li id="id=2_23">Item 2</li>
<li id="id=3">Item 3</li>
<li id="id=4">Item 4</li>
<li id="id=5">Item 5</li>
<li id="id=6">Item 6</li>
</ul>
On the serialize method, I want it to pull everything after the equal sign (=)
$(function () {
$("#MyList, #OtherList").sortable({
connectWith: '.connectedSortable',
update: function () {
$("#MyListOrder").val($("#MyList").sortable('serialize', { regexp: '/(.+)[=](.+)/)' }));
}
}).disableSelection();
});
I tried the above, but that didn't quite work. My regexp expression is wrong and I don't know what it should be. Ideas?