Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 14 days ago. Improve this question my regex looks like this: this returns the results just fine: regex value 11 11,2 5 5,2 11 11,4 6 6,6 however when a value
Tag: regex
SQL – trimming values before bracket
I have a column of values where some values contain brackets with text which I would like to remove. This is an example of what I have and what I want: I have only come across approaches that use the number of characters or the position to trim the string, but these values have varying lengths. One way I was
Snowflake Regular Expression
I have this string in Snowflake column: I need to get names in this format regardless of the number of company names: “SpecTra, Signal Capital Partners”. In other words, I need to extract company names and concatenate them. I have tried this : and regexp_substr() function, but did not get the desired output Can you please help me with this?
translate query from Oracle to Postgres
I need to translate this query from Oracle to Postgres: can someone help me? thanks in advance for your attention and support Answer In postgres the operateur ~ performs a regex comparison as thus replaces the Oracle function regexp_like(). Your query therefore becomes. I would like to alert your attention that the test not upper(location) ~ ‘^[0-9]{1,5}.* [a-z]’ will always
REGEXP_SUBSTR to extract a substring from Vertical SQL
I am trying to run the below query to get a substring from a string but it gives wrong result. I am not sure how to use the regex since the regex I am using works well with PCRE. I am expecting to get ndehqb-a3g4-a10 in this case but it prints the original string itself. The ask is to get
SQL, extract everything before 5th comma
For example, my column “tags” have I’m trying to return everything before 5th comma. below is the result example I’ve tried below code but it’s not working. Answer You can use See the regex demo. The REGEXP_REPLACE will find the occurrence of the following pattern: ^ – start of string (([^,]*,){4}[^,]*) – Group 1 (1 refers to this part of
REGEXP_REPLACE Strings Starting and Ending with Specific Substrings in Snowflake
I am trying to create a column in a view in Snowflake that replaces any string between strings that I care about with nothing. This is essentially for the purpose of stripping html formatting out of text. As an example: Would should end up like this: Based on the patterns I am seeing, I think that if I can eliminate
Oracle : Select only particular value from a row
I have a like below data : so i wanted to remove all the value after = and before | except for 1234. expected data : Answer You can use: Which, for the sample data: Outputs: VALUE 1234=A||1456=||1789= 1245=||1234=V 1234,1133 1456=||1234=1,234||1234 sqlfiddle here
How to regex match multiple items
I have a reviews table as follows: r_id comment 1 Weight cannot exceed 40 kg 2 You must not make the weight go over 31 k.g 3 Don’t excel above 94kg 4 Optimal weight is 45 kg 5 Don’t excel above 62 kg 6 Weight cannot exceed 7000g What I want to select is the weight a r_id’s cannot exceed.
Extract a desired character from an alphanumeric column using concise REGEX in Oracle SQL
I am going through a “clean-up” process of a character column that holds employee rankings that should have a single character: 0-5 or M or U but instead it has up to 3 characters that are either numeric, alpha or alphanumeric. I spent the better part of two days researching online (Regex, Stack overflow and Oracle resources) and testing and