the problem is it finds
DST=192.168.1.1 but it should only
It depends a lot on the tool you use. For example with sed this might give you want you want.
echo "... SRC=10.1.1.1 DST=192.168.1.1 LEN=40 ..." | \
sed -e 's/.*DST=\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/g'
See this article about regex grouping.
If you are trying to do highlighting this looks like what you may want/need. From the configuration.
# cs_re_s:<color>:<regular expression>
# Like cs_re but only the substrings are used(!). E.g.:
# In the example above only what matches between '(' and ')' is
# assigned a color. See the 'acctail' colorscheme for an example.
There is even an example that in that file close to what I believe you want. The example is
cs_re_s:cyan:kernel: .*(SRC=[^ ]*) *(DST=[^ ]*) What you want which I think is to highlight anything following a DST may be
cs_re_s:red:kernel: .*DST=([^ ]*).