62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 10 Dec 2015 12:25 PM |
txt:match(" all")
I'm trying to get "all" from a string only if it stands alone.
It works even if it's like this:
(kill allexample
That shouldn't work, yet it does.
|
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 10 Dec 2015 12:30 PM |
Using whitespace patterns aren't working either! It only works if you put a space or something after it.
txt:match("all%s") |
|
|
| Report Abuse |
|
|
|
| 10 Dec 2015 12:35 PM |
| " all$" might work. space, then "all", then end of line. |
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
| |
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 10 Dec 2015 12:35 PM |
| Too early of a bump. Thanks man, I shall try this. |
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
| |
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 10 Dec 2015 12:46 PM |
Why is this not working?
txt:find(" random()$")
And, it works if you type in 'random' but it doesn't work if you type in the full command 'random()'
And I only want it to work if you type in 'random()' not 'random' |
|
|
| Report Abuse |
|
|
|
| 10 Dec 2015 01:31 PM |
http://wiki.roblox.com/index.php?title=String_pattern#Captures
You have to escape the parenthesis with %:
STR:match('random%(%)$');
Note that the $ anchor signifies the end of the string, so if you say something like:
"make random() colors"
That will NOT be picked up. |
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
| |
|