Question: I'm currently looking through the Dajax examples on <http://www.dajaxproject.com/pagination/> and when I execute the Random Number Example and the Simple Form Example, I could see:

[20/Jul/2012 15:06:37] "POST /dajaxice/couch.randomize/ HTTP/1.1" 200 61

[20/Jul/2012 15:06:38] "POST /dajaxice/couch.updatecombo/ HTTP/1.1" 200 438

These information tells me that the corresponding ajax tasks are being executed. Now I'm trying to do the pagination example, but I don't know how to trigger my ajax, there's no onclick or onchange event and it's supposed to load directly when i serve my page. 

When I use a button (onclick event) to invoke my pagination, it worked.

What am I missing here? Thanks.

Answer: 
```
<?php

$str = "Hello world!%1, abcdef%2, gfgf%14";

$match_count = preg_match_all("/%\d+/", $str);

echo $match_count;

```

By the way, `$matches` will hold all of the matched substrings.
`preg_match_all` returns the number of matches.

```
$r = "Hello world!%1, abcdef%2, gfgf%14";
echo preg_match_all('/\%\d+/', $r, $matches);
// in PHP >= 5.4 you can leave out $matches

```

Result:

```
3

```