问题
is it possible to match this string with using regex? The whole string is wrapped with p tags and last 2 with strong tags.
BESbswyBESbswyBESbswyBESbswy BESbswy BESbswy
Thanks!
回答1:
yes, it is, something like this
<?php $string = '<p>BESbswyBESbswyBESbswyBESbswy<strong>BESbswy</strong><strong>BESbswy</strong></p>' ?>
<?= preg_replace('|<p>BESbswyBESbswyBESbswyBESbswy<strong>BESbswy</strong><strong>BESbswy</strong></p>|','aa',$string) ?>
来源:https://stackoverflow.com/questions/26118999/php-preg-replace-besbswy-ckeditor