A
A
asel0000000000000002022-04-05 10:12:50
Java
asel000000000000000, 2022-04-05 10:12:50

What regular expression can be used here?

data = data.replaceAll(", 6", ",\n6");
data = data.replaceAll(",6", ",\n6");
data = data.replaceAll(", 6", ",\n6");
data = data.replaceAll(", 5", ",\n5");
data = data.replaceAll(", 7", ",\n7");
data = data.replaceAll(", 8", ",\n8");

How can these strings be replaced with a regular expression?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2022-04-05
Hasanly @azerphoenix

Good afternoon.
data = data.replaceAll(",\s?(\d{1})", ",\n$1");
https://regex101.com/r/A5Ffkx/1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question