RegEx replacement is not working as expected

Started by rmpf2

rmpf2

RegEx replacement is not working as expected   18 June 2025, 05:07

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 last version the output looks like this "1-2-3 on 4:5" and not what it should be for date and time.


2) 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.
SoftPerfect Support forum - Andrew avatar image

Re: RegEx replacement is not working as expected   18 June 2025, 13:21

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!

Reply to this topic

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 **        **      **  **    **  **     **   ******  
 **        **  **  **  ***   **   **   **   **    ** 
 **        **  **  **  ****  **    ** **    **       
 **        **  **  **  ** ** **     ***     **       
 **        **  **  **  **  ****    ** **    **       
 **        **  **  **  **   ***   **   **   **    ** 
 ********   ***  ***   **    **  **     **   ******  

Message: