Jump to content

StringRegExpReplace tip


Recommended Posts

Please i need help to get all expression matching a proxy adress (some thing like this: 192.155.0.24:8080)

my idea is to replace all no maching proxy adresse to ""

Like this:

$sPattern="^(\d+\p\d+\p\d+\p\d+\p\d+)"

$sReplace=""

StringRegExpReplace( $sMyText, $sPattern , $sReplace)

but i have no succeed because of caret (^) ...

so my question is how to say NOT (\d+\p\d+\p\d+\p\d+\p\d+) ?

or is there a better way to get all these matching expressions (proxy:port) ?

thinks and sorry for my poor english

Link to comment
Share on other sites

[^blah blah]

example:

MsgBox(0, "Regular Expression Replace Test", StringRegExpReplace_

("Where have all the flowers gone, long time passing?", "[^aeiou]", "@"))

<{POST_SNAPBACK}>

sorry but your solution is wrong ! [^aeiou] means (not a and not e and net i and not o...) and my problem is to say NOT (all strings as proxy:port)

this is a part of the texte:

balabalabalabalaba 15h djjhd

125.44.241.21:8080 an other balabla 25 mars

dgdjljlqjh 215.126.144.14:31 balablabbba

Edited by supergg02
Link to comment
Share on other sites

sorry, i don't understand

try it!

example:

#include <array.au3>

$var=StringRegExp("125.44.241.21:8080 an other balabla 25 mars"_

,"(\d+\.\d+\.\d+\.\d+:\d+)",2)

_ArrayDisplay($var,"")

<{POST_SNAPBACK}>

GREAT !! it work ! thinks a lot for your help.

Now i understand :) all these confusing :D options in StringRegExp help file

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...