VoxCommando
Help and Support (Using VoxCommando) => VoxCommando Basics and Core Features => Topic started by: nime5ter on February 21, 2014, 06:14:05 PM
-
The regex cheatsheet that is mentioned in the wiki and in the regex action descriptions (http://www.mikesdotnetting.com/Article/46/CSharp-Regular-Expressions-Cheat-Sheet) includes a couple of regular expression operators that use curly brackets:
{n} n is a non-negative integer. Matches exactly n times. For example, "o{2}" does not match the "o" in "Bob," but matches the first two o's in "foooood".
{n,} n is a non-negative integer. Matches at least n times. For example, "o{2,}" does not match the "o" in "Bob" and matches all the o's in "foooood." "o{1,}" is equivalent to "o+". "o{0,}" is equivalent to "o*".
{n,m} m and n are non-negative integers. Matches at least n and at most m times. For example, "o{1,3}" matches the first three o's in "fooooood." "o{0,1}" is equivalent to "o?".
Is it possible to use those in Vox, given that VC uses curly brackets for its variables?
-
You have to be careful. If you try to use {2} in an expression, VC will try to replace it with payload 2. If there is no payload 2 then it will leave it as is, so if you know your command is being executed without any payloads then you are free to use {2} in your expression.
If you know your command has a payload 2 attached to it, then you will need to avoid using the regex expression {2}. This is relatively easy to do.
For example if you want to match exactly two digits using regex you can use any of the following patterns
\d\d
\d{2}
\d{2,2}
So you can use the first or the last option and just not use the middle one.
-
Okeydoke. Makes sense, thanks!