Per Jessen wrote:
> tedd wrote:
>
>> But as it is now, it's not so much IF the domain name is easy to
>> type in or not, but rather does the Rx.com show up in the URL once
>> you get there? And it does for most browsers other than IE.
>>
>> You can get to the site very easily, try typing:
>>
>
tedd wrote:
> But as it is now, it's not so much IF the domain name is easy to
> type in or not, but rather does the Rx.com show up in the URL once
> you get there? And it does for most browsers other than IE.
>
> You can get to the site very easily, try typing:
>
> http://rx-2.com
>
> That wa
tedd wrote:
> However, it's one thing to have a keyboard designed for a specific
> language and another to be able to enter code-points that aren't
> associated with any specific language (i.e., Dingbats and Math
> Symbols).
Ah yes, that's true. How about an APL2 keyboard then? :-)
> For examp
At 9:34 AM +0200 8/28/08, Per Jessen wrote:
Yeti wrote:
That Rx.com domain name is really great stuff, but how do you expect
the average user to type it in?
Sorry, I don't understand the problem. The average user will obviously
have a suitable keyboard, such as this for instance:
http://
At 9:29 AM +0200 8/28/08, Yeti wrote:
That Rx.com domain name is really great stuff, but how do you expect
the average user to type it in?
Of course the problem has always been how can the user enter these
types of characters from their keyboard. But, that's pretty simply
with a Mac and as t
Yeti wrote:
> That Rx.com domain name is really great stuff, but how do you expect
> the average user to type it in?
>
Sorry, I don't understand the problem. The average user will obviously
have a suitable keyboard, such as this for instance:
http://en.wikipedia.org/wiki/Image:KB_Swiss.svg
/
That Rx.com domain name is really great stuff, but how do you expect
the average user to type it in?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Kevin Waterson wrote:
> There is no silver bullet regex to validate all RFC compliant email
> address. Many have tried, but they all fail at some point. The best
> you can do is cater to most _sane_ addresses.
>
Exactly - the regex is a quick/cheap sanity check, nothing more. To go
all the way,
tedd wrote:
> The WG did solve this issue and came up with a way to do that -- the
> current algorithm is called PUNYCODE which allows Unicode code-points
> to appear in a domain name. I know this to be true because I have
> several domains that lie outside the standard ASCII AND they are real
> d
Honestly, I'd stick to using php's filter extension.
It -should- be the best one out there. If it is not processing
something it should, then it's a bug - submit it so all of us benefit
:)
I am tired of trying to find regexps and all that every time, I put my
stock into PHP's core when I can.
On
This one time, at band camp, Yeti <[EMAIL PROTECTED]> wrote:
> # this one worked fine for me, but it does not cover the full RFC
> like: "name" [EMAIL PROTECTED] OR name <[EMAIL PROTECTED]>
> $regex =
> "^[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+)[EMAIL
> PROTE
At 8:35 PM +0200 8/27/08, Per Jessen wrote:
> So, regardless of the documentation, which may be outdated, I know
> that Unicode characters can be used in IDNS and thus on both sides of
the @,
You're wrong - IDNs only apply to the right side of the @. (check out
what the 'D' means).
The D
At 8:35 PM +0200 8/27/08, Per Jessen wrote:
Go on, send me that email to '[EMAIL PROTECTED]' ... for what it's worth, I
can't even define an account like that, so my mailserver might well
reject it.
Yes, you are right.
I was thinking of something else, namely that the
LHS of the email address
Per Jessen a écrit :
I don't know, but I suspect due to lack of support in popular mailers
and mail-servers. Also, the use of quotes does make it cumbersome to
work with, both as a user and as a mailserver admin.
I had to write some pieace of code that can handle "toto toto"@ndd
five year
Lupus Michaelis wrote:
> Per Jessen a écrit :
>
>> That format is about as dead as the dinosaurs.
>
>Why ?
I don't know, but I suspect due to lack of support in popular mailers
and mail-servers. Also, the use of quotes does make it cumbersome to
work with, both as a user and as a mailserve
Per Jessen a écrit :
That format is about as dead as the dinosaurs.
Why ?
--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
tedd wrote:
>
>>No, they can't. There are no 8-bit characters allowed in an
>>email-address. Check out RFC2821.
>
> You can throw all the facts and documentation you want at me, but the
> left side of the @ has always been open to anything you want.
Except anything 8-bit, yes. Seriously, r
At 7:55 PM +0200 8/27/08, Lupus Michaelis wrote:
mike a écrit :
php should have a good check built-in.
see http://www.php.net/manual/en/function.filter-var.php
Argh ! Howmany times it is in ? I spent so
many time to write a regex that belongs the
RFC822 :-/ Because all the regex in answe
At 6:30 PM +0200 8/27/08, Per Jessen wrote:
Well, I left that for the OP to figure out. Still, your regex is
worse - a domain name cannot contain '%'. The only valid characters
for a domain name are letters, numbers and a hyphen. Also, maximum
length for a domain name is 64 characters, which c
Lupus Michaelis wrote:
>Argh ! Howmany times it is in ? I spent so many time to write a
>regex
> that belongs the RFC822 :-/ Because all the regex in answer here was
> false. They don't allow email like "Mickael Doodoo"@lupusmic.com nor
That format is about as dead as the dinosaurs. I kn
mike a écrit :
php should have a good check built-in.
see http://www.php.net/manual/en/function.filter-var.php
Argh ! Howmany times it is in ? I spent so many time to write a regex
that belongs the RFC822 :-/ Because all the regex in answer here was
false. They don't allow email like "Mic
Yeti wrote:
> # this one worked fine for me, but it does not cover the full RFC
> like: "name" [EMAIL PROTECTED] OR name <[EMAIL PROTECTED]>
> $regex =
> "^[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+/=\
\^_`\{\|}~-]+)[EMAIL PROTECTED](\.[a-z0-9-]+)*\.([a-z]{2,})$";
For the domain
tedd wrote:
>>
>>Option 1: /[EMAIL PROTECTED]/
>>
>>This is probably what you meant:
>>
>>/[EMAIL PROTECTED]/
>>
>>/Per Jessen, Zürich
>
> Which is probably what you meant:
>
> eregi("[EMAIL PROTECTED],6}$", $email)
>
> Email comes in different TLD flavors.
Well, I left that for the OP to fi
$regex =
"^[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+)[EMAIL
PROTECTED](\.[a-z0-9-]+)*\.([a-z]{2,})$";
if (eregi($regex, $email)) {
// do something
}
# Beware that the filter functions only work under PHP5+. If your PHP
supports them they should be the preferred
At 9:31 AM +0200 8/27/08, Per Jessen wrote:
VamVan wrote:
Hello Guys,
Does any have a regex for email validation? I need to allow only
period and underscore in the local part , we would need a @ and .com
or watever for domain.
Option 1: /[EMAIL PROTECTED]/
This is probably what you me
> Does any have a regex for email validation? I need to allow only period and
> underscore in the local part , we would need a @ and .com or watever for
> domain.
You could:
1. Take the isValidInetAddress() method out of the PEAR Mail_RFC822
class and use that.
2. Use the filter extension which I
That's a very handy extension.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
mike wrote:
>
> php should have a good check built-in.
>
> see http://www.php.net/manual/en/function.filter-var.php
>
> if(!filter_var($var, FILTER_VALIDATE_EMAIL)) {
> echo "inv
VamVan wrote:
> Hello Guys,
>
> Does any have a regex for email validation? I need to allow only
> period and underscore in the local part , we would need a @ and .com
> or watever for domain.
Option 1: /[EMAIL PROTECTED]/
This is probably what you meant:
/[EMAIL PROTECTED]/
/Per Jessen, Z
> On 8/27/08, VamVan <[EMAIL PROTECTED]> wrote:
> Hello Guys,
>
> Does any have a regex for email validation? I need to allow only period and
> underscore in the local part , we would need a @ and .com or watever for
> domain.
php should have a good check built-in.
see http://www.php.net/manual/e
> sorry to bother you richard.
You didn't, I just wanted to make sure I wasn't losing it (more).
--
Richard Heyes
++
| Access SSH with a Windows mapped drive |
|http://www.phpguru.org/sftpdrive|
++
--
PHP G
On Thu, 2008-06-05 at 00:24 -0400, Nathan Nobbe wrote:
>
> you really know how to rub it in there rob. but i was looking at the
> implementation in the php code, looks like somebody likes my idea
> (this code
> found in ext/standard/string.c). on the second line the haystack is
> converted to low
On Wed, Jun 4, 2008 at 11:43 PM, Robert Cummings <[EMAIL PROTECTED]>
wrote:
> On Wed, 2008-06-04 at 23:20 -0400, Nathan Nobbe wrote:
> >
> > i repeated your test using the time program and splitting the script into
> 2,
> > one for each strpos and stripos, to find similar results. imo, there is
>
On Wed, 2008-06-04 at 23:20 -0400, Nathan Nobbe wrote:
>
> i repeated your test using the time program and splitting the script into 2,
> one for each strpos and stripos, to find similar results. imo, there is no
> need for 2 comparisons for case-insensitive searches, because both arguments
> can
On Wed, Jun 4, 2008 at 2:06 PM, Robert Cummings <[EMAIL PROTECTED]>
wrote:
> On Wed, 2008-06-04 at 11:18 -0600, Nathan Nobbe wrote:
> > On Wed, Jun 4, 2008 at 11:12 AM, Robert Cummings <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Did you just try to use a test that used a single iteration to prove me
On Wed, 2008-06-04 at 11:18 -0600, Nathan Nobbe wrote:
> On Wed, Jun 4, 2008 at 11:12 AM, Robert Cummings <[EMAIL PROTECTED]>
> wrote:
>
> > Did you just try to use a test that used a single iteration to prove me
> > wrong? OMFG ponies!!! Loop each one of those 10 million times, use a
> > separate
On Wed, 2008-06-04 at 13:12 -0400, Robert Cummings wrote:
> On Wed, 2008-06-04 at 10:56 -0600, Nathan Nobbe wrote:
> > On Wed, Jun 4, 2008 at 10:26 AM, Robert Cummings <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Nope, case insensitive is slower since you must make two tests for
> > > characters havin
On Wed, Jun 4, 2008 at 11:12 AM, Robert Cummings <[EMAIL PROTECTED]>
wrote:
> Did you just try to use a test that used a single iteration to prove me
> wrong? OMFG ponies!!! Loop each one of those 10 million times, use a
> separate script for each, and use the system time program to
> appropriatel
at least he have some humer ;-)
On 04/06/2008, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> On Wed, 2008-06-04 at 10:56 -0600, Nathan Nobbe wrote:
> > On Wed, Jun 4, 2008 at 10:26 AM, Robert Cummings <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Nope, case insensitive is slower since you must make tw
On Wed, 2008-06-04 at 10:56 -0600, Nathan Nobbe wrote:
> On Wed, Jun 4, 2008 at 10:26 AM, Robert Cummings <[EMAIL PROTECTED]>
> wrote:
>
> > Nope, case insensitive is slower since you must make two tests for
> > characters having a lower and upper case version. With case sensitive
> > comparisons
I can't find any good reason for regex in this case.
you can try to split it with explode / stristr / create a function by your
own which goes over the string and check when a @ is catched, something
like:
function GetDomainName ($a)
{
$returnDomain = "";
$beigale = false;
for ($i = 0; $i < strl
On Wed, Jun 4, 2008 at 10:26 AM, Robert Cummings <[EMAIL PROTECTED]>
wrote:
> Nope, case insensitive is slower since you must make two tests for
> characters having a lower and upper case version. With case sensitive
> comparisons you only need to make a single comparison.
a quick test shows str
On Wed, 2008-06-04 at 10:18 -0600, Nathan Nobbe wrote:
> On Wed, Jun 4, 2008 at 10:10 AM, Richard Heyes <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > and the case insensitive versions are a hair faster still ;)
> >>
> >
> > Are they? I always thought that case-sensitive functions were faster
> > b
On Wed, Jun 4, 2008 at 10:10 AM, Richard Heyes <[EMAIL PROTECTED]> wrote:
> Hi,
>
> and the case insensitive versions are a hair faster still ;)
>>
>
> Are they? I always thought that case-sensitive functions were faster
> because they have to test fewer comparisons. Eg To test if i == I in a
> c
Hi,
and the case insensitive versions are a hair faster still ;)
Are they? I always thought that case-sensitive functions were faster
because they have to test fewer comparisons. Eg To test if i == I in a
case-insensitive fashion requires two comparisons (i == I and i == i)
whereas a case-s
On Tue, Jun 3, 2008 at 8:39 PM, VamVan <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> For example I have these email addressess -
>
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
> What would be my PHP function[Regular expression[ to that can give me some
> thing like
>
> yahoo.com
> h
You can use this:
$str = '[EMAIL PROTECTED]';
preg_match('/[EMAIL PROTECTED]@(.+)/', $str, $matches);
var_dump($matches);//will be in $matches[1]
Or without regex:
echo substr($str, strpos($str, '@')+1);
Liran
- Original Message -
From: "VamVan" <[EMAIL PROTECTED]>
To:
Sent: We
Ryan S wrote:
Hey!
Thansk for replying!
It is obvious I haven't had my caffeine yet. This is my last try to
get the pattern straight:
hello
hello
those
hello
hello
this
rose
hello
nose
hello
that
hello
END_OF_HTML;
$tags = array();
$tags[] = 'p';
$tags[] = 'a';
$attr = array();
$attr[] =
Pretty close.
The only thing I'd suggest is a different way of wording step 2:
Can contain anything but '>' until step 3.
As for the switches/modifiers (Uis), check out:
http://us.php.net/manual/en/reference.pcre.pattern.modifiers.php
U = ungreedy
i = case-insensitive (|p| matches 'p' and/or 'P'
> http://www.ezee.se/tests/para_regex2.php.txt
Yep, sorry... Just add the s
preg_match_all('|]*>(.*)|Uis', $myText, $myArray);
Swett! It works!
If you _do get time_, would love to know the actual meaning of
|]*>(.*)|Uis
because although I do appreciate the help and the code, am learni
Ryan S wrote:
preg_match_all('|]*>(.*)|Ui', $myText, $myArray);
Hey!
Thanks for replying.
Your preg_match_all works like a charm, but for some reason catches only 8 out
of 9 paragraphs... its really weird. I have upped the test page to
http://www.ezee.se/tests/para_regex2.php.txt so you
preg_match_all('|]*>(.*)|Ui', $myText, $myArray);
Hey!
Thanks for replying.
Your preg_match_all works like a charm, but for some reason catches only 8 out
of 9 paragraphs... its really weird. I have upped the test page to
http://www.ezee.se/tests/para_regex2.php.txt so you can have a look
Ryan S wrote:
To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text
with different html tags in them, but each "block" of text has a or a <
class="something"> tag... anybody have any regex that will catch each of these paragraphs and p
Aschwin Wesselius wrote:
Aschwin Wesselius wrote:
Ryan S wrote:
Hey all!
To say I suck at regex is an understatement so really need any help
I can get on this, I have a page of text with different html tags in
them, but each "block" of text has a or a < class="something">
tag... anybody h
Aschwin Wesselius wrote:
Ryan S wrote:
Hey all!
To say I suck at regex is an understatement so really need any help I
can get on this, I have a page of text with different html tags in
them, but each "block" of text has a or a < class="something">
tag... anybody have any regex that will ca
Ryan S wrote:
Hey all!
To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text
with different html tags in them, but each "block" of text has a or a <
class="something"> tag... anybody have any regex that will catch each of these paragraph
> To say I suck at regex is an understatement so really need any help I can
> get on this, I have a page of text with different html tags in them, but each
> "block" of text has a or a < class="something"> tag... anybody have any
> regex that will catch each of these paragraphs and put then
On Mon, May 5, 2008 at 9:59 PM, Ryan S <[EMAIL PROTECTED]> wrote:
> To say I suck at regex is an understatement so really need any help I can
> get on this, I have a page of text with different html tags in them, but each
> "block" of text has a or a < class="something"> tag... anybody have any
On Sun, February 17, 2008 9:34 am, Valedol wrote:
> Is there a mothod to check string`s length with regex or the only way
> is
> using strlen?
>
> I want string consisting of 4 digits
> and check string with this code:
>
> if (preg_match("/\d{4}/",$_POST[id]))
> { echo $_POST[id]; }
>
> but preg_
Valedol wrote:
Is there a mothod to check string`s length with regex or the only way is
using strlen?
I want string consisting of 4 digits
and check string with this code:
if (preg_match("/\d{4}/",$_POST[id]))
{ echo $_POST[id]; }
but preg_match returns true when string consists of 4 or more
--- Valedol <[EMAIL PROTECTED]> wrote:
> Is there a mothod to check string`s length with regex or the only
> way is
> using strlen?
>
> I want string consisting of 4 digits
> and check string with this code:
>
> if (preg_match("/\d{4}/",$_POST[id]))
> { echo $_POST[id]; }
>
> but preg_match
Is there a mothod to check string`s length with regex or the only way is
using strlen?
I want string consisting of 4 digits
and check string with this code:
if (preg_match("/\d{4}/",$_POST[id]))
{ echo $_POST[id]; }
but preg_match returns true when string consists of 4 or more digits
You co
Valedol wrote:
> Is there a mothod to check string`s length with regex or the only way is
> using strlen?
>
> I want string consisting of 4 digits
> and check string with this code:
>
> if (preg_match("/\d{4}/",$_POST[id]))
> { echo $_POST[id]; }
>
> but preg_match returns true when string cons
t; $tbl_name1 = preg_replace('/\s/', '_', $tbl_name1);
> $col_name2 = preg_replace('/\s/', '_', $col_name2);
>
>
> $sql = << $sql_query
> $tbl_name.$col_name,
> $tbl_name1.$col_name2
> OUT;
>
> echo "Contents of \$sql: $
You'd need to use a "look-ahead" or "look-behind" with PCRE to do this.
Search for a thread just last week involving quotes and HTML
attributes for an example.
PS
You could probably get the DB to ignore case in table names and table
fields with some kind of "set".
You also could probably just re
Jim Lucas wrote:
Peter wrote:
I am trying to convert ms access sql to postgresql using php.
I have a sql statement in the form ;-
$sql = SELECT DISTINCT [Table Name].[Column.Name], [Table Name
1].[Column Name 2] etc.
what I want to end up with is $sql = SELECT DISTINCT
table_name.column_nam
Jim Lucas wrote:
Peter wrote:
I am trying to convert ms access sql to postgresql using php.
I have a sql statement in the form ;-
$sql = SELECT DISTINCT [Table Name].[Column.Name], [Table Name
1].[Column Name 2] etc.
what I want to end up with is $sql = SELECT DISTINCT
table_name.column_nam
Peter wrote:
I am trying to convert ms access sql to postgresql using php.
I have a sql statement in the form ;-
$sql = SELECT DISTINCT [Table Name].[Column.Name], [Table Name 1].[Column
Name 2] etc.
what I want to end up with is $sql = SELECT DISTINCT table_name.column_name,
table_name_1.co
he above code is not optimal, but it works OK.
I use the heredoc construct to build my sql query strings.
Saves using all those single and double quote characters.
http://uk2.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
HTH
Keith Roberts
-
Well actually not a real lot so far. I'm just trial and error(lots of that)
at the moment. I've only been 'playing with php for about a month or so.
$file = "phptest1.txt";
$rep = array ("tbl_" , "_%", "bool default 0", "bool default 1", '?');
$wih = array ("", "_pc", "bool DEFAULT FALSE", "bool D
Can yo upost the code you have got to do the conversion
so far please?
Regards
Keith
-
Websites:
http://www.karsites.net
http://www.php-debuggers.net
http://www.raised-from-the-dead.org.uk
All email addresses are challenge-respon
Robin Vickery schreef:
[snip]
Because each of your subpatterns can match an empty string, the
lefthand subpattern always matches and the righthand subpattern might
as well not be there.
Indeed they do, i did not realise that.
The simplest solution, if you don't want to completely rethink yo
On 30 October 2007 11:07, Stijn Verholen wrote:
> Hey list,
>
> I'm having problems with grouped alternative patterns.
> The regex I would like to use, is the following:
>
> /\s*(`?.+`?)\s*int\s*(\(([0-9]+)\))?\s*(unsigned)?\s*(((auto_i
> ncrement)?\s*(primary\s*key)?)|((not\s*null)?\s*(default\
On 30/10/2007, Stijn Verholen <[EMAIL PROTECTED]> wrote:
> Hey list,
>
> I'm having problems with grouped alternative patterns.
> The regex I would like to use, is the following:
>
> /\s*(`?.+`?)\s*int\s*(\(([0-9]+)\))?\s*(unsigned)?\s*(((auto_increment)?\s*(primary\s*key)?)|((not\s*null)?\s*(defau
On Fri, 2007-10-19 at 09:48 -0700, Kevin Murphy wrote:
> I'm trying to create an advanced search feature for my site, and I
> have it mostly working the way I want. I take whatever search term
> ($searchkey) that the user submits, explodes if off any spaces
> between words, and then use that
Søren Neigaard wrote:
> It works fine, but my friend strangely enough has users with special
> danish letters (æøåÆØÅ) in their email address, and that it does not
> accept.
Hej Søren
I just realised - you can't have those characters in the email address.
You may have them in the name part, bu
On 9/24/07, Per Jessen <[EMAIL PROTECTED]> wrote:
> > Hi guys
> >
> > Im helping a friend with hes internet site, and I have found this
> > regex email validation regex on the internet:
> >
> > var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-
> > z]{2,6}(?:\.[a-z]{2})?)$/i;
> >
Søren Neigaard wrote:
> Hi guys
>
> Im helping a friend with hes internet site, and I have found this
> regex email validation regex on the internet:
>
> var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-
> z]{2,6}(?:\.[a-z]{2})?)$/i;
> if(!filter.test(email)) {
> return false
On Wed, March 14, 2007 7:56 pm, jekillen wrote:
> Hello;
> The following regex:
>
> ereg(" id='$m[1]'>", $groups, $m1);
>
> is causing the following error:
>
> Warning: ereg() [function.ereg]: REG_ERANGE in _proc.php on
> line 81
>
> Can someone tell me what this means?
You used to have the -
jekillen wrote:
Hello;
The following regex:
ereg("id='$m[1]'>", $groups, $m1);
is causing the following error:
Warning: ereg() [function.ereg]: REG_ERANGE in _proc.php on
line 81
Can someone tell me what this means?
What I am trying to do is pick out some info from an xml tag the is
id'd
On Sat, February 3, 2007 12:58 pm, Manolet Gmail wrote:
> anyway, PCRE is better that ereg?
Yes!
Faster, easier, more flexible, and better documented.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
On Sat, 2007-02-03 at 13:58 -0500, Manolet Gmail wrote:
> 2007/2/3, Steffen Ebermann <[EMAIL PROTECTED]>:
> > You have to use preg_match_all()
> >
> > if (preg_match_all("!\"(.+)\"!sU", $var, $match))
> >
> >
>
> oh wow! works very well... but... i take 2 days reading about ereg ='(
> there is
Side note:
$exp = explode('"', $var);
foreach ($exp as $key => $val) if ($key%2!=0) $arr[] = $val;
var_dump($arr);
works without regular expressions.
--
Steffen
On Sat, Feb 03, 2007 at 12:36:59PM -0500, Manolet Gmail wrote:
> Hi, i have a problem using regex, i want to get all the text b
well thanks you too much, i will learn the preg sintax.
2007/2/3, Steffen Ebermann <[EMAIL PROTECTED]>:
I don't know, but http://php.net/manual/en/function.ereg.php says
"Note: preg_match(), which uses a Perl-compatible regular expression
syntax, is often a faster alternative to ereg
I don't know, but http://php.net/manual/en/function.ereg.php says
"Note: preg_match(), which uses a Perl-compatible regular expression
syntax, is often a faster alternative to ereg()."
On Sat, Feb 03, 2007 at 01:58:50PM -0500, Manolet Gmail wrote:
> anyway, PCRE is better that ereg?
2007/2/3, Steffen Ebermann <[EMAIL PROTECTED]>:
You have to use preg_match_all()
if (preg_match_all("!\"(.+)\"!sU", $var, $match))
oh wow! works very well... but... i take 2 days reading about ereg ='(
there is no way to do this using ereg an not preg (PCRE)...
anyway, PCRE is better that
You have to use preg_match_all()
if (preg_match_all("!\"(.+)\"!sU", $var, $match))
On Sat, Feb 03, 2007 at 12:36:59PM -0500, Manolet Gmail wrote:
> Hi, i have a problem using regex, i want to get all the text between " "
>
> so i try this...
>
> $subject = 'menu "Archer?",-,"Chief?",L_Menu2,
On Thu, October 19, 2006 9:42 am, Robin Vickery wrote:
> On 19/10/06, Bagus Nugroho <[EMAIL PROTECTED]> wrote:
>> Hi All,
>>
>> If we have variable like :
>>
>> $var1 = 'abcde 12';
>> $var2 = 'abcdefghi 34';
>> $var3 = 'abc 20 def';
>>
>> Then we want output like :
>> $var1 = 'abcde';
>> $var2
On 19/10/06, Bagus Nugroho <[EMAIL PROTECTED]> wrote:
Hi All,
If we have variable like :
$var1 = 'abcde 12';
$var2 = 'abcdefghi 34';
$var3 = 'abc 20 def';
Then we want output like :
$var1 = 'abcde';
$var2 = 'abcdefghi';
$var3 = 'abc def';
$re = '/^\s+|\d+\s*|\s*\d+\s*$/';
$var1 = preg_repl
Bagus Nugroho wrote:
If we have variable like :
$var1 = 'abcde 12';
$var2 = 'abcdefghi 34';
$var3 = 'abc 20 def';
Then we want output like :
$var1 = 'abcde';
$var2 = 'abcdefghi';
$var3 = 'abc def';
How regex can help us?.
It's very difficult to get the right solution to a problem when all yo
On 19 Oct 2006, at 07:56 , John Nichel wrote:
$var3 = 'abc 20 def';
Then we want output like :
$var3 = 'abc def';
How regex can help us?.
Use preg_replace to replace all numbers with nothing.
$var = preg_replace ( "/\d+/", "", $var );
Nope, that will leave
$var3 = 'abc def';
(note the dou
On 19 Oct 2006, at 07:49 , Bagus Nugroho wrote:
Hi All,
If we have variable like :
$var1 = 'abcde 12';
$var2 = 'abcdefghi 34';
$var3 = 'abc 20 def';
Then we want output like :
$var1 = 'abcde';
$var2 = 'abcdefghi';
$var3 = 'abc def';
How regex can help us?.
Well, stripping the digits is eas
Bagus Nugroho wrote:
Hi All,
If we have variable like :
$var1 = 'abcde 12';
$var2 = 'abcdefghi 34';
$var3 = 'abc 20 def';
Then we want output like :
$var1 = 'abcde';
$var2 = 'abcdefghi';
$var3 = 'abc def';
How regex can help us?.
Use preg_replace to replace all numbers with nothing.
$var
On Mon, August 21, 2006 4:51 am, Nadim Attari wrote:
> I have some text in a table... the text contains hyperlinks (but not
> html coded, i.e. plain "Some text...http://www.something.com";)
>
> When i retrieve these texts from the table, i want the hyperlinks to
> become clickable, i.e.
> "Some te
[snip]
Do you have to use ereg? The preg_match pattern I posted works fine.
It will return an array, first element being the whole string it
matched, next element will be what it matched _inside_ the parentheses
(less the parentheses) (if it matches anything that is).
[/snip]
Thanks Johnth
Jay Blanchard wrote:
[snip]
Anot PCRE. Can't help you there, as I've never used the ereg
functions. However...
preg_match ( "/\((\d{1,}.*?)\)/", "Upper Voltage (124.1)", $regs );
[/snip]
Still returns parentheses
ereg("[^\(][0-9\.]*" , "Upper Voltage (124.1)", $regs );
gets rid of
[snip]
Anot PCRE. Can't help you there, as I've never used the ereg
functions. However...
preg_match ( "/\((\d{1,}.*?)\)/", "Upper Voltage (124.1)", $regs );
[/snip]
Still returns parentheses
ereg("[^\(][0-9\.]*" , "Upper Voltage (124.1)", $regs );
gets rid of opening bracket, but
e
Jay Blanchard wrote:
[snip]
\(([0-9]*)\)
[/snip]
I had done this before and still get the parenthesis...
ereg("\(([0-9]*)\)", "Upper Voltage (124.1)", $regs);
Anot PCRE. Can't help you there, as I've never used the ereg
functions. However...
preg_match ( "/\((\d{1,}.*?)\)/", "U
[snip]
You won't match the dot btw:
\(([.0-9]*)\)
Which is crude since it will match more than one dot :)
[/snip]
Typo on my part \(([0-9\.]*)\)...but still gets parenthesis
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[snip]
\(([0-9]*)\)
[/snip]
I had done this before and still get the parenthesis...
ereg("\(([0-9]*)\)", "Upper Voltage (124.1)", $regs);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Mon, 2006-06-19 at 14:42, John Nichel wrote:
> Jay Blanchard wrote:
> > I have a field that contains a value in parenthesis', but also contains
> > other text, for instance; (it is a legacy app that I am working with,
> > and by legacy I am saying pre-1980)
> >
> > Upper voltage (124.1)
> >
>
101 - 200 of 578 matches
Mail list logo