Why is the value of b not 2?
Note that there is a space after 1.
Code: Select all
a := "
(
1
2
)"
RegExMatch(a, "(?<=\s)[^\s]*", b)
msgbox % b
Code: Select all
a := "
(
1
2
)"
RegExMatch(a, "(?<=\s)[^\s]*", b)
msgbox % b
Code: Select all
a =
(
1
2
)
Code: Select all
a := ""
. 1 "`n"
. 2
matches 2match 0 or more non-whitespace char(s), preceeded by a whitespace char
Code: Select all
a := "
(
1
2
)"
RegExMatch(a, "(?<=\s)[^\s]*", b)
msgbox % b
Remember, AHK's RegExMatch works only once starts from the beginning."match 0 or more non-whitespace char(s), preceeded by a whitespace char"
Looks like you are confusing yourself. There is an alternative way to do it, if you simply want to know what's in a particular row. As long as you know the row of what you want, it can be simple to get. Just so you know.
Code: Select all
a =
(
1
2
)
Loop, parse, a, `n
{
if (A_Index = 2)
{
Output := A_Loopfield
}
}
msgbox % Output
Users browsing this forum: Google Adsense [Bot], yuu453 and 301 guests