Jump to content

Help on stringregexpreplace() with regular expression

Recommended Posts



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..


Share this post

Link to post
Share on other sites
Posted (edited)

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

Share this post

Link to post
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