I've been hitting a brick wall with trying to use the following regex in PHP.
<li.*?class="(.*?gchoice.*?)">((.|\n)*?)<\/li>
This works fine in the following test selecting only the nested list item when i try it in a jquery based tester
<li class="gfield gfield_contains_required" id="field_1_17">
<label class="gfield_label">Categories<span class="gfield_required"> (Required) </span> </label>
<div class="ginput_container">
<ul id="input_1_17" class="gfield_checkbox">
<li class="gchoice_17_1">
<input type="checkbox" id="choice_17_1" value="First Choice" name="input_17.1">
<label id="label_17_1" for="choice_17_1">First Choice</label>
</li>
</ul>
</div>
</li>
However in PHP it just doesn't want to work no matter how I try to escape the characters and no matter the delimiter I try and use. From what I know I should only need a / or # at the stand and end, however when that did not work I tried escaping the brackets as well and yet it still didn't work.