Problem with Regex_Replace
Question

I have four actions "Regex_Replace"


First Regex_Replace "$"

Second "#"

Third "@"

Why does it only transmit "$", the rest of the characters are not displayed in printed form. How to fill in the pattern correctly

mvp_badge
MVP
Solution

Hi All,

Mr. Kan approached me personally for the solution to this problem. After investigating the case, below were the findings and solution.

Case:

Objective: Generating word document (dynamic) on the fly using an external extension (built in Java technology)

Platform stack: Java

OutSystems:

  • Action referenced from the external extension for generating the word document was throwing an error "illegal group reference" when parsing attribute values like $$$@#773
  • I got the reason for the caused error by referring to this post - https://stackoverflow.com/a/11913767
  • As a solution, using the replace function, I replaced the $ character with '\$' (single backslash) before passing the value to the respective extension action and it worked perefectly.


kind regards,

Benjith Sam

mvp_badge
MVP

Hi there,


You should use the result of one Regex_Replace as the Text input for the other, like in the image below where the result of the first is the input of the next one:



Kind Regards,
João

I did not understand a little, you can explain in more detail

Where will he get the symbols from?

My symbols are taken from the database

you wrote what I already did

Hi Kan,

You should use the first regex result in second regex action and then second regex result in the third one and so on. then you will get all the replace text.


Regards,

Shoen

Hi Kan,

Where you are displaying the output if regex replace use their  "Regex_Replace.Output" and you will be able to see the out put of each regex.


I print in word document

Hi kan,

Please find attached OML here for your query 

RegexDemo.oml

You misunderstood.


I already have data stored in the database.


The name is stored in the database - "@di#bb$" 



I need this name from database printed correctly.



In my case example

Pattern - "@"

Replace - ASCII code

mvp_badge
MVP
Solution

Hi All,

Mr. Kan approached me personally for the solution to this problem. After investigating the case, below were the findings and solution.

Case:

Objective: Generating word document (dynamic) on the fly using an external extension (built in Java technology)

Platform stack: Java

OutSystems:

  • Action referenced from the external extension for generating the word document was throwing an error "illegal group reference" when parsing attribute values like $$$@#773
  • I got the reason for the caused error by referring to this post - https://stackoverflow.com/a/11913767
  • As a solution, using the replace function, I replaced the $ character with '\$' (single backslash) before passing the value to the respective extension action and it worked perefectly.


kind regards,

Benjith Sam

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.