Jump to content

Recommended Posts

Posted

hmm doesnt work for me...

i did notice a typo ("$RegExpReplace" to "StringRegExpReplace") in your last entry - fixed it - but still doesnt work...

Posted

Hey, can you summarize your problem?

The string and how does your result need to look like?

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Posted

here is the string

Last Intruder Address:

TCP/IP Network Address

IP Address: 30.20.212.274

Maximum Connections: 6

Login Script:

map k:=lo-ncs_usrs2_server\usrs2:

@NET USE x: \\loap01\tms

Login Time: 05:09:48 am 03/11/10

modifiersName: CN=CGNDSDR1

Network Address:

TCP/IP Network Address

IP Address: 30.20.12.14

i am trying to grab "IP Address" value for Last Intruder Address

i am also trying to grab IP Address value for Network Address (which i think should look similar)

Posted (edited)

$str = 'Last Intruder Address:' & @CRLF & _
'TCP/IP Network Address' & @CRLF & _
'IP Address: 30.20.212.274' & @CRLF & _
'Maximum Connections: 6' & @CRLF & _
'Login Script:' & @CRLF & _
'map k:=lo-ncs_usrs2_server\usrs2:' & @CRLF & _
@CRLF & _
'@NET USE x: \\loap01\tms' & @CRLF & _
'Login Time: 05:09:48 am 03/11/10' & @CRLF & _
'modifiersName: CN=CGNDSDR1' & @CRLF & _
'Network Address:' & @CRLF & _
'TCP/IP Network Address' & @CRLF & _
'IP Address: 30.20.12.14'

$re = StringRegExp($str , 'IP Address: ([\d\.]+)', 3)
_ArrayDisplay($re)

Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Posted

very cool but i definitely want to make sure i grab the right one..

unfortunately, sometimes the fields are missing or out of order

so id definitely want to grab IP Address under "Last Intruder Address"

and IP Address under "Network Address"

thanks for your help!

Posted

$str = 'Last Intruder Address:' & @CRLF & _
        'TCP/IP Network Address' & @CRLF & _
        'IP Address: 30.20.212.274' & @CRLF & _
        'Maximum Connections: 6' & @CRLF & _
        'Login Script:' & @CRLF & _
        'map k:=lo-ncs_usrs2_server\usrs2:' & @CRLF & _
        @CRLF & _
        '@NET USE x: \\loap01\tms' & @CRLF & _
        'Login Time: 05:09:48 am 03/11/10' & @CRLF & _
        'modifiersName: CN=CGNDSDR1' & @CRLF & _
        'Network Address:' & @CRLF & _
        'TCP/IP Network Address' & @CRLF & _
        'IP Address: 30.20.12.14'

$re = StringRegExp($str, '(?s)Last Intruder Address:.*?TCP/IP Network Address.*?([\d\.]+)', 3)
_ArrayDisplay($re)
$re1 = StringRegExp($str, '(?s)Network Address.*?TCP/IP Network Address.*?([\d\.]+)', 3)
_ArrayDisplay($re1)

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Posted

perfect!!!!

many many thanks xeno

No problem.

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...