Jump to content

Identify words in characters


Lukas
 Share

Recommended Posts

One way is to use RegExp.

Other way, use StringSplit,

$sTest = StringSplit("c:\test1\test2\file.txt","\",2)

MsgBox(64,"","You searched for "&$sTest[2]&" and " &$sTest[3])
Edited by taietel
Link to comment
Share on other sites

Hello, I want a solution to identifying only the words between certain characters.

Ex:

C:\test1\test2\file.txt

Identify only "test1", "test2" are among "\".

Thank you, perfect!

Another question please, in the case below:

test1/test2\test3/test4

Identify only "test2"and "test3", being among different characters "/" and "\"

as would be please?

Edited by LukaS
Link to comment
Share on other sites

$sTest = StringRegExpReplace("test1/test2\test3/test4", "\/", "\\")
$aTest = StringSplit($sTest,"\",2)
For $i=0 To UBound($aTest)-1
 ConsoleWrite($aTest[$i]&@CRLF);write to Scite console all the values
Next

Ask if it's unclear. Sorry for the delay, but my internet connection stinks.

Link to comment
Share on other sites

You are welcome!

One suggestion: when you reply, try to use Add Reply button from the button of the page. This way, the previous post is not copied (unless your intention is to quote, of course).

M.I.

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