Skip to main content

Questions tagged [regular-expression]

0 votes
1 answer
22 views

I'm trying to do a schema-only pg_dump of my database, however with data from one or two specific tables included. This means I can't use the --schema-only or --data-only options of pg_dump, and I can'...
Bergi's user avatar
  • 604
2 votes
2 answers
351 views

String-functions in Postgres do not recognize non-breaking-space as whitespace, neither when trimming nor when using regular expressions: select 'x' || test || 'x' , 'x' || trim(test) || 'x' ...
Rune's user avatar
  • 123
0 votes
3 answers
2k views

I wish to ... ... remove spaces ... delete apostrophes ... replace 'é' and 'è' with 'e' I use the function regexp_replace(). For the moment, I can delete the spaces but poorly. Indeed, when the ...
fcka's user avatar
  • 125
1 vote
1 answer
678 views

I am trying to write a regex that can replace '[', ']' and '].' with '_' and in cases where ']' is the last character it should be replaced with '' but I am struggling to come up with a regex for it ...
Pepe Silvia's user avatar
0 votes
1 answer
229 views

I have a column which contains string values of the format e.g AB12345678 - two letters followed by 8 numeric digits. I need to write a MySQL query to insert a 5 before each set of 4 digits thus ...
therobyouknow's user avatar
2 votes
3 answers
182 views

It is clear that omitting the length from a varchar is a bad thing. Unfortunately I am now working with a code base where this has happened. Extensively. I would like to correct this. The first step ...
Michael Green's user avatar
0 votes
0 answers
107 views

I just can't find an example of this anywhere and hoping someone can help. I have a query which returns a list of care services and other fields based on the care service table values and calculated ...
Paula Morrison's user avatar
0 votes
1 answer
333 views

I have a bunch of sloppy Geo text in a field. However the country/ state names or codes are relatively clean. It'll say Poland 23 or Illinois Remote or Frogballs, Germany or TX, AL, AK. I have a ...
user45867's user avatar
  • 1,739
1 vote
2 answers
2k views

Due to privacy concerns, I need to hide personal information, while remaining somewhat understandable. I propose to achieve that by hiding everything except the first two characters. The word length ...
oren's user avatar
  • 13
0 votes
1 answer
1k views

I have a column which will have values like: FC FCW FC,FCW FX,FC My input used for filtering should give correct result (match the exact value in the column) ex: FC like 'FC,FCW' --> true FC like '...
Ross's user avatar
  • 1
5 votes
1 answer
1k views

I have a query which is designed to loop and search addresses for duplicates, the query uses REGEX_REPLACE. I am trying to index on the regex as on doing an explain and its doing a sequential scan on ...
rdbmsNoob's user avatar
  • 459
0 votes
1 answer
938 views

I have a column of urls with some of the urls like www.google.com/// Need them to be www.google.com/ instead.
Dhaval Mohandas's user avatar
4 votes
1 answer
1k views

In my PostgreSQL 12.8 database, I have a relatively simple table the_table with a column value with type varchar: CREATE TABLE public.the_table ( id uuid DEFAULT gen_random_uuid() NOT NULL, ...
Fabian Jäger's user avatar
2 votes
2 answers
550 views

I have data in a table column like below: host=0.0.0.0 port=5432 dbname=database_name user=pglogicaluser host=0.0.0.0 port=5432 dbname=database_name2 user=pglogicaluser I want to write a query to get ...
Sayad Xiarkakh's user avatar
-1 votes
1 answer
6k views

I migrate from Oracle DB to Postgres/MS-SQL and I want to use REGEXP_SUBSTR equivalent with these databases. I need to rewrite this statement to these databases: SELECT b.id, b.name, b....
Sir Montes's user avatar

15 30 50 per page
1
2 3 4 5
10