Question

"$" Dollar Sign Not Allowed in A360?

  • 2 August 2022
  • 6 replies
  • 1353 views

Userlevel 3
Badge +9

Why do I get the following "Invalid Expression" when using the "$" symbol for regex end of line? This is a very common and basic regex functionality. Am I doing something wrong?imageThanks


6 replies

Userlevel 4
Badge +7

Hi @Logan Price​ ,

 

Could you let us know what exactly it is that you want to replace, and with what?

 

Kind Regards,

Ashwin A.K

Userlevel 3
Badge +9

Thanks, that is exactly what I needed! Also, your original comment that explained that a $$ is needed to escape the character is also true so I marked that as the best answer.

Userlevel 4
Badge +7

Hi @Logan Price​ 

 

I had a feeling that this is what you were trying to achieve.

 

If that is the case, then you have to understand that the String: Replace Action replaces the matched item, which means you have to match those items that you don't want in your string.

 

Here is a pattern that does just that:

.*\\

 

image 

Kind Regards,

Ashwin A.K

 

Userlevel 4
Badge +7

Hi @Logan Price​ ,

 

When you add a Dollar sign, Automation Anywhere thinks you are trying to reference a variable.

If you want Automation Anywhere to treat a dollar sign as a dollar sign then you have to escape it with another dollar sign like so:

 

([^(\\|\/)]+$$)

 

Could you give that a try and let us know if it works out for you?

 

Kind Regards,

Ashwin A.K

Userlevel 3
Badge +9

Sure. Let's say that the $AATaskNAme$ gives the following string:

 

\Bots\Sample1\Sample2\Sample3\Sample4\Match_This_String

 

I want to isolate "Match_This_String".

 

My strategy for doing so is to match every character after the final slash ("\" or "/").

 

The result of my Regex should be a string variable containing only:

 

"Match_This_String

Userlevel 3
Badge +9

I get the following error:image

Reply