You can use Wordpress::Grep under the same terms as Perl itself.