Extractor pattern

I have two conditions to decide if continue going to the next page.
One is
48

The other one is
class="pagerNotCurrent">Next

Either one finds pattern, it will call next_page script..

How should I apply this situation?

I tried using sub-extractor pattern but didn't work out.

Thank you!