generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Strings

Previous Thread :: Next Thread 
62GB is not online. 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 is not online. 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
RenderSettings is not online. RenderSettings
Joined: 16 Aug 2010
Total Posts: 2560
10 Dec 2015 12:35 PM
" all$" might work. space, then "all", then end of line.
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
10 Dec 2015 12:35 PM
Bump?
Report Abuse
62GB is not online. 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 is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
10 Dec 2015 12:36 PM
Thanks, it works!
Report Abuse
62GB is not online. 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
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
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 is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
10 Dec 2015 01:52 PM
Thank you. :)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image