(https?://)?(www.)?[0-9A-Za-z]+\.com/[0-9A-Za-z]+/\?paged=[0-9]+

i am getting this error in php

Warning: preg_match_all() [function.preg-match-all]: Unknown modifier '?' in C:\xampp\htdocs\expression.php on line 19

i have test it on online testers it is giving correct results but when i ran it in preg match it gave above error

Recommended Answers

All 2 Replies

could you... umm... post a little bit more of your code?

You should use it like this:

$result = preg_replace('%(https?://)?(www.)?[0-9A-Za-z]+\.com/[0-9A-Za-z]+/\?paged=[0-9]+%im', '', $subject);

Perhaps you forgot to add the modifiers around your regex (% in this case, but it could be another character) ...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.