You can translate the question and the replies:

Question on Regular expression

Scenario 1. One column is there with the name of d1 and its row value is : "The cookies of this site". 2. I want the value of second word only("The cookies") not using INSTR/Substring but using regexp. 3. I tried to select only two initial words using regexp regexp(d1, '[a-z0-9]+(\s+[a-z0-9]+)?',<What should I give here so it does not gets replaced(If I give a blnk space here it will replace The cookies with blank space) >) 4. I want result as "The cookies" [a-z0-9]+(\s+[a-z0-9]+)? This exression will select "The cookies" from above test
user
29-08-2022 02:14:49 -0400
code

1 Answer

Hello, The REGEXP function replaces each substring of the input that matches the regular expression with a given replacement. Therefore it's an expected result to get an empty space if a blank is used for the replacement. Currently there is no available function to extract words that match the given regular expression within the input string. If I would like to get desired string from the input string, I would create a custom function by referencing to [How to develop a Virtual DataPort Custom Function](https://community.denodo.com/tutorials/browse/customcomponents/2function) in the Custom Components of Denodo Tutorials. If you have a valid support user account and need this function, please open an enhancement request for a new function that can extract desired parts from a given string at support.denodo.com. Hope this helps!
Denodo Team
29-08-2022 18:51:02 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here