#1  
Old 12th January 2010, 10:39
Horfic Horfic is offline
Senior Member
 
Join Date: Mar 2009
Location: Austria
Posts: 325
Thanks: 55
Thanked 93 Times in 58 Posts
Send a message via Skype™ to Horfic
Default Regex Pattern

Hi,
I'm having troubles figuring the regex pattern out for this here:
cc “!info@example.tld”

The email is changing the cc “{email}” stays always the same.

So what would it be so I can extract the email out of this string.

PS: This is just an extract from the custom_mailfilter, so there is more text around it.
__________________
web wack creations - We create your custom web application
Mailuser interface for ISPConfig 3
Reply With Quote
Sponsored Links
  #2  
Old 13th January 2010, 08:52
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
 
Default

maybe this gives you a hint:

PHP Code:
<?php

$str 
"asdasasasd cc \"!info@example.tld\"  asdasdasdsad";

if( 
preg_match("/cc \"(.*)\"/"$str$matches) ) {
   
var_dump($matches);
}
else {
   
//String was not found
}

?>
where $matches[1] would be the string within "". You might also think of using another regex to match a more or less real syntax for emailadresses instead of matching any string between "" ( -> (.*) ).
Reply With Quote
The Following User Says Thank You to Ben For This Useful Post:
Horfic (13th January 2010)
Reply

Bookmarks

Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need fail2ban regex for apache with ISPConfig AlArenal Server Operation 5 28th June 2014 02:55
Keep folders/icons arranged in a certain pattern? (Nautilus or Gnome Desktop) leepov Desktop Operation 0 20th May 2009 18:49
REGEX expression to ignore commas in quotes tlsuess Programming/Scripts 2 11th July 2008 09:35
Delete whole line based on pattern ramangill Programming/Scripts 1 2nd November 2007 15:33
Problem with perl in Debian Sarge nenad Programming/Scripts 7 9th July 2006 14:04


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


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.