|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
shandley14 Smarty Rookie
Joined: 20 Aug 2003 Posts: 10
|
Posted: Tue Jan 27, 2004 10:47 pm Post subject: strip before a character |
|
|
i have a list of spammers in a email database, I have called the list to a page with smarty, and i want to strip all the text before the @ sign so that i can include these domains in my black-list.txt file for procmail.
so i have
name@blahblah.com
and i want a modifier that will turn that into
@blahblah.com
or blahblah.com, and i could add the @ sign in the template
is there a modifier for this already, or do i have to write my own.
thanks for the time _________________ wolfram 30 --- 6-170 ---- upper v |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Jan 27, 2004 11:10 pm Post subject: |
|
|
you can use regex_replace:
{$address|regex_replace:"/(.*@)/":"@"}
but i wouldn't put the regex in the template. i'd encapsulate that in a custom modifer. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|