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
 

Re: what am i do wrong

Previous Thread :: Next Thread 
Borsy is not online. Borsy
Joined: 31 Jul 2014
Total Posts: 15111
28 Jul 2016 02:13 PM
local scraped = [[ [li class="profile-stat"]
[p class="text-label"]Forum Posts[/p]
[p class="text-lead"]7993[/p]
[/li] ]]

print(scraped:match('[p class="text-lead"]7993[/p]'))


(prints out nil)


r+://449719662r+://449719756r+://449719862
Report Abuse
Borsy is not online. Borsy
Joined: 31 Jul 2014
Total Posts: 15111
28 Jul 2016 02:22 PM
h e l p


r+://449719662r+://449719756r+://449719862
Report Abuse
widejimmyjames3 is not online. widejimmyjames3
Joined: 18 May 2013
Total Posts: 39
28 Jul 2016 02:58 PM
you didn't pay attention in english class. kappa.
Report Abuse
Borsy is not online. Borsy
Joined: 31 Jul 2014
Total Posts: 15111
28 Jul 2016 03:06 PM
this isnt grammar class


r+://449719662r+://449719756r+://449719862
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
28 Jul 2016 03:09 PM
local scraped = [[ [li class="profile-stat"]
[p class="text-label"]Forum Posts[/p]
[p class="text-lead"]7993[/p]
[/li] ]]

local numPosts = scraped:match('%[p class="text%-lead"%](%d+)%[/p%]')

print("Posts: "..numPosts)
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
28 Jul 2016 03:13 PM
http://wiki.roblox.com/index.php?title=String_patterns

"Any non-magic character (not one of ^$()%.[]*+-?), represents itself in a pattern. To search for a literal magic character, precede it by a % - for example, to look for a percent symbol, use %%."
Report Abuse
Borsy is not online. Borsy
Joined: 31 Jul 2014
Total Posts: 15111
28 Jul 2016 03:56 PM
ok but how do i make it so it ensures it's from [p class="text-label"]Forum Posts[/p] and not something like [p class="text-label"]Place Visits[/p]


r+://449719662r+://449719756r+://449719862
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
28 Jul 2016 05:20 PM
local scraped = [[ [li class="profile-stat"]
[p class="text-label"]Forum Posts[/p]
[p class="text-lead"]7993[/p]
[p class="text-label"]Place visits[/p]
[p class="text-lead"]1000[/p]
[/li] ]]

local matches = {}

for v in scraped:gmatch('%[p class="text%-lead"%](%d+)%[/p%]') do
table.insert(matches, v)
end

local numPosts = matches[1]
local placeVisits = matches[2]

print("Posts: "..numPosts)
print("Place visits: "..placeVisits)
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