Jump to content

Generic character in string


Recommended Posts

Hi,

I can't get the expression for a variable string. I've looked into Stringregexp function to find how i could replace a letter by \w. But no success.

I tried to use the " * " as for a file name with any extension : "File.*"

here is my point :

i would like to find in a file these expressions:

sharedFolder0.hostPath = "D:\"

sharedFolder1.hostPath = "O:\"

$NewDirectory

_replacestringinfile("Directory",'sharedFolder0.hostPath = "???"','sharedFolder0.hostPath = $NewDirectory')

What must i put instead of "???" ?

Help please!

Link to comment
Share on other sites

thx for replying that fast.

Should i use it like that : 'sharedFolder0.hostPath = "[^"]:"' It doesn't work.

I've tried [] or [.] too

Edited by Chlar
Link to comment
Share on other sites

Sorry, missed the * in my last post. Should have been "[^"]*". You don't need the : as that pattern matches anything between " and ".

Edit: You should also get used to escaping characters. So you should use: sharedFolder0.hostPath

Edited by Mat
Link to comment
Share on other sites

Is this correct : 'sharedFolder0.hostPath = "[^"]*"' Cause it still doesn't work...

Maybe there is a problem with the quotes

Sorry for being dumb i am so bad with that character section of autoit...

Link to comment
Share on other sites

Yes it's working but it seems like this doesn't work for the _replacestringinfile UDF...

By the way thank you i will look for another solution, this one was too simple to be true... ;)

Edited by Chlar
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...