RegEx replacement not working as expected

2 posts · Closed

rmpf2 Guest
17 Jun 2025
  1. RegEx replacement is not working as expected:

Example from an old forum reference:
... a string like this in the yyyymmddHHMMSS.mmmmmmsUUU format (see CIM_DATETIME description):
20190104140000.111597+600
... return a raw timestamp value. Then apply the following regular expression to this column:
(\d{4})(\d{2})(\d{2})(\d{2})(\d{2}).*
Use this as the replacement expression:
\1-\2-\3 on \4:\5
In the last version the output looks like this "1-2-3 on 4:5" and not what it should be for date and time.

  1. Feature request:

Ability to maximize Visible Columns windows like in Remote Scripting windows where there are three control buttons in the top right corner (MINIMIZE, MAXIMIZE and CLOSE). Best to see RegExs and Highlights or when dragging (move) up or down rows to reorder.

Andrew SoftPerfect
18 Jun 2025

Network Scanner uses a slightly different syntax for backreferences. Like JavaScript, Python and Perl, it uses $1 $2 $3 instead of \1 \2 \3. Therefore, you simply need to replace this

\1-\2-\3 on \4:\5

with this

$1-$2-$3 on $4:$5

and it will work as expected.

The Visible Columns dialog was made resizable in the latest builds - thanks for the feedback!

This topic is closed. It has had no new posts for over a year, so the software versions it talks about may be out of date. Start a new topic in Network Scanner if you have a similar question.