Skip to main content

@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!

@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.


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)'


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.


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)


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)

 


Reply