Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

strip before a character

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
shandley14
Smarty Rookie


Joined: 20 Aug 2003
Posts: 10

PostPosted: Tue Jan 27, 2004 10:47 pm    Post subject: strip before a character Reply with quote

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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Jan 27, 2004 11:10 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP