You can translate the question and the replies:

regexp on a string of data between special characters

Hello, I have a data coming to a coloum as following, $kjsfdlesjfdflkdfche$ something. some more text $ornikvempo$ few more text I need to select the column to look as -- something. some more text few more text, basically I want to remove everything inside $....$. I tried using regex but regex supports specific number of characters.. Can you help me achieve this. Thanks, Gokul
user
05-11-2019 12:03:42 -0500

3 Answers

Hi, I would use a combination of various text processing functions like INSTR, SUBSTRING, REGEXP, etc. to extract the text from the fields based on my requirement. You could take a look at [Text Processing Functions](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/appendix/syntax_of_condition_functions/text_processing_functions#text-processing-functions) section under the Virtual DataPort VQL Guide for more details. Hope this helps!
Denodo Team
06-11-2019 05:52:02 -0500
Thank you for the Reply. I am using the below expression and It is clearing out the first occurance but not the next occurances. regexp(column,SUBSTRING(coloum,INSTR(column, '$'),INSTR(column, '$')+1),' ') Can you please help me if I am missing anything.
user
06-11-2019 07:49:12 -0500
Hi, Looking at the example data, I noticed that your use case includes removing the inline text from the string. I would make use of the [REGEXP](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/appendix/syntax_of_condition_functions/text_processing_functions#regexp) expression in my query such that the inline text is eliminated based on the requirement. For example: `select regexp('$mysampledata$ text to display $moredata$ text','\$[\s\S]*?\$|([^:]|^)\/\/.*$','');` This expression will eliminate the occurences of '$' and the data enclosed within '$'. Hope this helps!
Denodo Team
13-11-2019 01:36:27 -0500
You must sign in to add an answer. If you do not have an account, you can register here