Jump to content

Help on stringregexpreplace() with regular expression


Recommended Posts

Hello,

I was working for my autoit application, where I had to replace a string with "". String is:

Dollar Zero $i Zero Only 

I have to replace "Dollar Zero" with ""

also, "Zero Only" with ""

so that at last, I must end up with $i 

I tried on constructing regex code for above but not getting proper result, Can you guys do something for this..

Thanx.!

Link to comment
Share on other sites

Not sure what you mean - is $i a variable or do you mean literally "Dollar Zero $I Zero Only" 

if literally then

$input = "Dollar Zero $i Zero Only"
$output = StringRegExpReplace($input, ".*?(\$i).*?$", "$1")

or hundreds of other ways using various string functions.

Edited by Jury
additional info
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...