Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #46  
Old 02-03-2010, 10:15 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
I ran into my situation with my setguild script where I needed some basic wildcard's for filtering error chat.

For example, "You must way %d seconds to use that command again!" would have bee useful. I ended up just matching the beginning and the end of the chat anyways, however.
Reply With Quote
  #47  
Old 02-03-2010, 10:17 PM
Immolate Immolate is offline
Indigo
Join Date: Dec 2009
Posts: 322
Immolate is on a distinguished road
Quote:
Originally Posted by DustyPorViva View Post
I ran into my situation with my setguild script where I needed some basic wildcard's for filtering error chat.

For example, "You must way %d seconds to use that command again!" would have bee useful. I ended up just matching the beginning and the end of the chat anyways, however.
I'd like something like that for getstringkeys().
Reply With Quote
  #48  
Old 02-03-2010, 10:58 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Yeah's the kind of things I wanted to be able to do.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #49  
Old 02-09-2010, 07:47 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Hmmm It could be interesting to add support for pcre. You basicly just want one command with a string and a regular expression as parameters and you get back a string?
Reply With Quote
  #50  
Old 02-09-2010, 07:57 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Stefan View Post
Hmmm It could be interesting to add support for pcre. You basicly just want one command with a string and a regular expression as parameters and you get back a string?
I'm not sure how it's usually used, but I would assume a function would also be needed to check a string against a regular expression. For example, ensuring that a string is only alphanumeric.
__________________
Reply With Quote
  #51  
Old 02-09-2010, 09:03 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
I imagine people would want both a

string.match(pattern) -> boolean

and a

string.replace(pattern, replacement_string) -> string

Where the replacement_string could include back-references (like $1 or $2) if pattern includes capturing parenthesis.


I still think this is a bad idea though.
Reply With Quote
  #52  
Old 02-09-2010, 11:15 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Yeah, match and replace would be nice. And I still think that the fact that not everyone could use it is not a valid reason for not having it, that's just silly.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #53  
Old 02-09-2010, 11:44 PM
tempandrew tempandrew is offline
Registered User
Join Date: May 2005
Posts: 98
tempandrew is on a distinguished road
Quote:
Originally Posted by WhiteDragon View Post
I imagine people would want both a

string.match(pattern) -> boolean

and a

string.replace(pattern, replacement_string) -> string

Where the replacement_string could include back-references (like $1 or $2) if pattern includes capturing parenthesis.


I still think this is a bad idea though.
This should be implemented ASAP. I can think of a lot of situations where a replace command would be great.
Reply With Quote
  #54  
Old 02-10-2010, 12:22 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by WhiteDragon View Post
I still think this is a bad idea though.
Matching should return or make accessible the part of the string that was actually matched (probably just offset, length) and all the parenthesised groups.

Replacing should optionally take a function instead of a string that is called with the matched part and groups and returns a replacement string.

Reply With Quote
  #55  
Old 02-10-2010, 12:47 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Loriel View Post
Matching should return or make accessible the part of the string that was actually matched (probably just offset, length) and all the parenthesised groups.

Replacing should optionally take a function instead of a string that is called with the matched part and groups and returns a replacement string.

I like the way you are thinking. I wouldn't mind having something that works just as Lua's string.gsub() does.
__________________
Reply With Quote
  #56  
Old 02-10-2010, 01:00 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by Stefan View Post
Hmmm It could be interesting to add support for pcre. You basicly just want one command with a string and a regular expression as parameters and you get back a string?
If you do it exactly like WhiteDragon said I will love you forever and ever.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #57  
Old 05-16-2010, 10:02 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Three month bump.

I'm finding myself wanting this more and more
Even Javascript has support built into the language (it's literally in the syntax) for Regular Expressions, come on now.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #58  
Old 08-21-2010, 03:24 PM
MrDunne MrDunne is offline
Registered User
Join Date: Aug 2010
Posts: 38
MrDunne is on a distinguished road
Bump.
Reply With Quote
  #59  
Old 08-21-2010, 04:53 PM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
Do it.
__________________
Trying to be nice now...
Reply With Quote
  #60  
Old 08-12-2011, 06:10 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Bumping because I'd really like this
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.