How to make a field deselected and none viewing in Regular Experession (regex)?

52 Views Asked by At

I want to write a regular expression for extract selected fields in a the one line:

for example with this line

(2017-11-01 time=14:07:41)

i want write a regex to extract below result:

2017-11-01 14:07:41

in other words i want to showing a one group (2017-11-01 14:07:41) without the "time=" characters.

1

There are 1 best solutions below

4
Bohemian On

You can't do it with 1 group. Regex groups can't "skip" over characters.

You can do it with 2 groups:

\((.*? )time=(.*?)\)

or simpler, use regex replace in your language:

Search: \((.*? )time=(.*?)\)
Replace: $1$2   (or \1\2 depending on your language/tool)