S
S
sidor_tank2019-12-09 08:50:19
Oracle
sidor_tank, 2019-12-09 08:50:19

How to write a Regex in oracle so that it replaces repeated characters in the string '12233444' => '1234'?

Everything seems to be simple ... But something doesn’t work out for me

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
riot26, 2019-12-09
@sidor_tank

<?php
$re = '/([0-9])\1*/m';
$str = '12233444';
$str = preg_replace($re, '$1', $str);
echo $str; // 1234

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question