Skip to main content
Solved

Attempting to combine mulitple string replacements in attribute manager text editor

  • February 13, 2024
  • 5 replies
  • 152 views

stephen.bosse11
Participant
Forum|alt.badge.img+1

@ReplaceRegularExpression(@Value(DETAILS),<.+?>,,caseSensitive=FALSE), @ReplaceString(@Value(DETAILS),&qout;,",caseSensitive=TRUE)

 

The first expression replaces any text in details attribute that is bracketed with <> to be deleted.

the second expression replaces any instance where &qout; appears with “.

These work fine as separate transformations, however when trying to lump them into a single statement in attribute manager’s text editor the transform fails.

I’ve tried comma separating, spacing, and barring the functions, but have had no luck. Any suggestions on how to get this to run?

 

Thanks!

Best answer by dustin

@ReplaceRegularExpression(@ReplaceString(@Value(DETAILS),&qout;,"\"",caseSensitive=TRUE),<.+?>,,caseSensitive=FALSE)

Try this. If you want to string together multiple operations in a AttributeManager, you have to nest the operations. It won’t work by comma separating them. Also, the double quote you want to replace with will need to be escaped using \, and also placed in double quotes itself.

View original
Did this help you find an answer to your question?

5 replies

dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • Best Answer
  • February 13, 2024
@ReplaceRegularExpression(@ReplaceString(@Value(DETAILS),&qout;,"\"",caseSensitive=TRUE),<.+?>,,caseSensitive=FALSE)

Try this. If you want to string together multiple operations in a AttributeManager, you have to nest the operations. It won’t work by comma separating them. Also, the double quote you want to replace with will need to be escaped using \, and also placed in double quotes itself.


stephen.bosse11
Participant
Forum|alt.badge.img+1

Hi dustin, after running that I get this error

ERROR |AttributeManager_8: Unable to find closing bracket for function 'ReplaceRegularExpression' in '@ReplaceRegularExpression(@ReplaceString(@Value(DETAILS),&qout;,"\"",caseSensitive=TRUE),<.+?>,,caseSensitive=FALSE@ReplaceRegularExpression(@ReplaceString(@Value(DETAILS),&qout;,"\"",caseSensitive=TRUE),<.+?>,,caseSensitive=FALSE)'


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • February 13, 2024
stephen.bosse11 wrote:

Hi dustin, after running that I get this error

ERROR |AttributeManager_8: Unable to find closing bracket for function 'ReplaceRegularExpression' in '@ReplaceRegularExpression(@ReplaceString(@Value(DETAILS),&qout;,"\"",caseSensitive=TRUE),<.+?>,,caseSensitive=FALSE@ReplaceRegularExpression(@ReplaceString(@Value(DETAILS),&qout;,"\"",caseSensitive=TRUE),<.+?>,,caseSensitive=FALSE)'

Maybe I’m reading it wrong, but it looks like you copied the string in twice? There are two @ReplaceRegularExpressions in that error.


stephen.bosse11
Participant
Forum|alt.badge.img+1

And if I wanted to add a third function? for example:

@ReplaceRegularExpression(@ReplaceString(@Value(DETAILS),&quot;,"\"",caseSensitive=TRUE),@ReplaceString(@Value(DETAILS),&amp;,"\&",caseSensitive=TRUE),<.+?>,,caseSensitive=FALSE)


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • February 13, 2024
stephen.bosse11 wrote:

And if I wanted to add a third function? for example:

@ReplaceRegularExpression(@ReplaceString(@Value(DETAILS),&quot;,"\"",caseSensitive=TRUE),@ReplaceString(@Value(DETAILS),&amp;,"\&",caseSensitive=TRUE),<.+?>,,caseSensitive=FALSE)

Yes, you would just keep nesting the new function into the location of @Value(DETAILS). Although in this case, you shouldn’t need the quotes and the escape \ before the ampersand (I don’t think)

@ReplaceRegularExpression(@ReplaceString(@ReplaceString(@Value(DETAILS),&amp;,"\&",caseSensitive=TRUE),&qout;,"\"",caseSensitive=TRUE),<.+?>,,caseSensitive=FALSE)

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings