Search
Other ReReplacer questions
Forum

Remove big chunk of code with ReReplacer

David Boggitt's Avatar David Boggitt
Dear Peter,

Is it possible to replace this with nothing?
<li>
	<a href="/administrator/index.php?option=com_media">
		<span class="icon-pictures" aria-hidden="true"></span> <span class="j-links-link">Media Manager</span>	</a>
</li>

Many thanks,

Dave.
Peter van Westen's Avatar Peter van Westen ADMIN
Depending on how specific you want it:
<li>\s*<a href="[^"]option=com_media">.*?</a>\s*</li>
Or:
<li>\s*<a href="[^"]option=com_media">\s*<span[^>]*></span>\s*<span[^>]*>Media Manager</span>\s*</a>\s*</li>
Or:
<li>\s*<a href="[^"]option=com_media">\s*<span class="icon-pictures" aria-hidden="true"></span>\s*<span class="j-links-link">Media Manager</span>\s*</a>\s*</li>
Please post a rating at the Joomla! Extensions Directory
David Boggitt's Avatar David Boggitt
They didn't work, but I'm sure it's me, not you!

In the Details page, I've got everything as No apart from Regular Expressions. I'm pretty sure the Search Areas is correct, as it's working to replace some bits of it, I just wanted to get rid of that chunk of code completely.
Peter van Westen's Avatar Peter van Westen ADMIN
Use the View Source (raw html) to see what you actually need to search for. Don't use the Element Inspector.
Please post a rating at the Joomla! Extensions Directory
David Boggitt's Avatar David Boggitt
I was using that. Rather than take up more of your time, is there a specific RegEx site that I can test on? I have a feeling I remember there been slightly different versions of RegEx? Or something like that.
David Boggitt's Avatar David Boggitt
This worked:
<li>\s*<a href=".*option=com_media">\s*.*?</a>\s*</li>
Peter van Westen's Avatar Peter van Westen ADMIN
Oops, I was missing a character in my examples.
should have been:
<li>\s*<a href="[^"]*option=com_media">.*?</a>\s*</li>
Or:
<li>\s*<a href="[^"]*option=com_media">\s*<span[^>]*></span>\s*<span[^>]*>Media Manager</span>\s*</a>\s*</li>
Or:
<li>\s*<a href="[^"]*option=com_media">\s*<span class="icon-pictures" aria-hidden="true"></span>\s*<span class="j-links-link">Media Manager</span>\s*</a>\s*</li>
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription