Question: I have been tortured by this for quite a while.

Because of table sorter pagination will completely remove the invisible rows from the table for faster sorting. I could not get the checkbox in each row to work as my desired. 

Here is my jsfiddle -> 
<http://jsfiddle.net/NcqfY/3/>

*click the variable trigger to bring up the table*

Basically what I want to do is get the id for all selected rows and pushed them into an array `selectedID`. Empty `selectedID` array when the report is created (or the "create report" button is clicked). So after I clicked the button, I hope that all the checkboxes in the table should get unchecked. I am using the following code: 

`$('table.tablesorter tbody tr').find('input[type=checkbox]').prop('checked', false); 
// I can only uncheck the boxes in current page` 

However I can only uncheck the boxes in current page, not include the pages that are invisible. This really gives me hard time to get the correct ID for selected rows. 

Anyone could help me out would be greatly appreciated!

Answer: 
It's a [**positive lookahead**](http://www.regular-expressions.info/lookaround.html). In that particular expression, it is saying that your password must have at least two digits (`\d`).

Also note that a lookahead doesn't *consume* input, it is merely an **assertion**. 

For example, in your regex, the lookahead part (`(?=.*\\d.*\\d.*)`) asserts that your `password` contains at least two digits, and the rest of the expression consumes the entire string, and tries to match at least 8 word characters (i.e., `[a-zA-Z_0-9]`) at the beginning of the string.
It's a lookahead: A zero-width match that checks to see if the position is followed by the given expression.

<http://www.regular-expressions.info/lookaround.html>

In your scenario, you are looking for a string that:

* begins with a string containing two digits (enforced by the lookahead)
* begins with 8 word characters (matched by the rest of the regex)

The lookahead is not actually part of the match. It behaves much like a word boundary (`\b`) or beginning of string (`^`).