fixed the compile problem without pcre library

I changed your pull request a little. You can review and test it. If there is no problem, you can merge it. Then I will merge your pull request.

Thank you.