Jump to content

Regexp Need Help


Recommended Posts

hi folks..

im tryin to use the StringRegExp and StringRegExpReplace functions but dont get it work... i dont get a errorfree pattern...

i just want clear my CmdLineRaw from any chars exept "\", "-", "_", """, "'" and all blank chars, cause my script runs in errors, when chars like ":" or "/" are in the CmdLine...

StringRegExpReplace should replace the not wanted chars into "_"... like StringRegExpReplace ( CmdLineRaw, "pattern", "_")...

.. i tried realy hard to find the right pattern and googled around but i dont get it work..

..maybe u can help me out..

..salute

Link to comment
Share on other sites

  • Moderators

This:

$testcmdline = StringRegExpReplace($CmdLineRaw,"[^a-zA-Z0-9ÄÖÜäöüß\-_."&Chr(34)&" ]","")

..works great now... BUT.. please tell me what ASCII code is this character >>> ' <<<... its the sign on the same key as #...

..cant find the code for it . :think:

Do you mean just a single quote?

Opening:

Chr(96)

Closing:

Chr(39)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Mhhh.. I dont know.. isnt single quote this: ` ´ ?

..i mean this: '

...the char that is on same key with #

maybe it is.. ill check out.. didnt know that there is an open an close ... for same char...

if you go to the autoit helpfile, go to the index tab, and start typing 'ascii characters' it will be the second option by the time you've typed 'asc' that will give you the ascii values you're looking for (and even alot that you're not)
Link to comment
Share on other sites

  • Moderators

Mhhh.. I dont know.. isnt single quote this: ` ´ ?

..i mean this: '

...the char that is on same key with #

maybe it is.. ill check out.. didnt know that there is an open an close ... for same char...

Yeah man I'm lost... I don't have another key for/with #.

Guess you could try this and see if what you want is there:

For $x = 1 To 255
    ConsoleWrite('Chr(' & $x & ') = ' & Chr($x) & @LF)
Next

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Yeah man I'm lost... I don't have another key for/with #.

Guess you could try this and see if what you want is there:

For $x = 1 To 255
    ConsoleWrite('Chr(' & $x & ') = ' & Chr($x) & @LF)
Next
or just check out the help file so you can see the non printing characters too... :(:think:
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...