We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Find and Replace Plugin - multiples AND regex?

Development and Programming

Deborah Cross's avatar
Deborah Cross
113 posts
about 17 years ago
Deborah Cross's avatar Deborah Cross

Hi All,

I’m trying to use the find and replace plugin with both regex and multiple on:

{exp:replace find="<a ><\\/a><h2>(.+)<\\/h2>|<p>.+<\\/p>|<img.+>" replace="<p><a >$2</a></p>|<p>para</p>|<p>image</p>" regex="yes" multiple="yes"}
                  <a href="http://test%22name=%22test%22></a>h2test">test heading_para_image

__I’m getting:_

_<a href="test">test heading</a>

|
para
|
image

<a href="">

|
para
|
image

<a href="">

|
para
|
image

Any thoughts on what might be wrong? The doco doesn’t show any examples that use both regex and multiple, so maybe it can’t do that?

       
Deborah Cross's avatar
Deborah Cross
113 posts
about 17 years ago
Deborah Cross's avatar Deborah Cross

Not sure why, but some of the code dropped out - trying again - the preview says this should display accurately.

Nope - it is still stripping bits. Will try and attach instead.

       
Low's avatar
Low
407 posts
about 17 years ago
Low's avatar Low

Hi Deborah,

Here’s a quick quote from the docs:

The multiple parameter has no effect when using a regular expression find and replace.

So there you go. It’s not possible to combine the two, because the pipeline character is actually part of the regex syntax.

       
Deborah Cross's avatar
Deborah Cross
113 posts
about 17 years ago
Deborah Cross's avatar Deborah Cross

Thanx Lodewijk.

‘Must learn to read more carefully’ she mutters while beating herself about the head. 😉

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.