skip to Main Content

reg_replace in PostgreSql with pattern matching

I have below dataset, 1. '{SHEET,2730377,SHEET,5708283,DATA,3015937}' 2. '{SHEET,2730377,SHEET,5708283,DATA,3015937,DATA,0010965}' 3. '{SHEET,5708283,DATA,3015937,DATA,0010965}' 3. '{SHEET,5708283,DATA,3015937}' I need the result as, 1. {DATA,3015937} 2. {DATA,3015937,DATA,0010965} 3. {DATA,3015937,DATA,0010965} 4. {DATA,3015937} Basically I wanted to replace SHEET followed by 7 digit number and extract only DATA…

VIEW QUESTION

Special Regular Expression match in javascript

I need JavaScript special regex pattern to convert the input string to required string. Input String: google.com/q=abc?param1=[foo,bar]&optional=true&param2=[bar,baz] Output String: google.com/q=abc?param1=foo&optional=true&param2=bar This is my code. function transformUrl(inputUrl) { var pattern = /[([^,]]+),([^,]]+)]/g; var outputUrl = inputUrl.replace(pattern, function (match, group1) { return…

VIEW QUESTION

Php – regex just take last value

my problem is when regex get any value it just take last correct one input Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; SAMSUNG; GT-I8750) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Mobile Safari/537.36 Edge/15.15063 output i get Android what real output i want…

VIEW QUESTION
Back To Top
Search