Hi Kunal,
> ereg("(.*)", $lineofhtml, $output);
ereg("([^]*)", $lineofhtml, $output);
--
Jimmy
It's not what you have in your life that counts, but who you have in your life
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTE
Nopes, dint work
Regards,
Kunal Jhunjhunwala
- Original Message -
From: "Jimmy" <[EMAIL PROTECTED]>
To: "Kunal Jhunjhunwala" <[EMAIL PROTECTED]>
Cc: "php-list" <[EMAIL PROTECTED]>
Sent: Friday, January 11, 2002 9:30 AM
Subject: Re: [PHP] e
what about ?
ereg("(.*?)", $lineofhtml, $output);
-Original Message-
From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 11, 2002 3:05 PM
To: Jimmy
Cc: php-list
Subject: Re: [PHP] ereg
Nopes, dint work
Regards,
Kunal Jhunjhunwala
- Original Message
RE: [PHP] eregWarning: REG_ERANGE on line 83
83: ereg("(.*?)", $lineofhtml, $output);
Regards,
Kunal Jhunjhunwala
- Original Message -
From: Martin Towell
To: 'Kunal Jhunjhunwala' ; Jimmy
Cc: php-list
Sent: Friday, January 11, 2002 9:36 AM
Sub
You should use preg_match_all() for this.
Something like this should do (didn't try it thou):
preg_match_all("|(.*)\">|U", $lineofhtml,
$output, PREG_PATTERN_ORDER);
Niklas
-Original Message-
From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]]
Sent: 11. tammikuuta 2002 5:56
To: php-l
al Jhunjhunwala [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 11, 2002 3:05 PM
> To: Jimmy
> Cc: php-list
> Subject: Re: [PHP] ereg
>
>
> Nopes, dint work
> Regards,
> Kunal Jhunjhunwala
> - Original Message -
> From: "Jimmy" <[EMAIL PROTECT
On Tuesday, April 16, 2002, at 08:49 AM, [EMAIL PROTECTED] wrote:
>
> I'm new with RegEx and I would like to use them to validate my forms
> entries submitted to the server.
>
> My question is how can I verify with the regex that a string is
> - at least 7 chars
> - contains Chars and Nums
> -
cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Ereg ()
16/04/02 15:44
On Tuesday, April 16, 2002, at 09:51 AM, [EMAIL PROTECTED] wrote:
>
> Thanks for this answer.
>
> But how can i test if i actually have numbers AND letters ?
preg_match('/([A-Za-z].*[\d]|[\d].*[A-Za-z]/', $string);
Untested, but in theory should work.
> On Tuesday, April 16, 2002, at 08:49
On Friday 03 May 2002 12:51, Jason Soza wrote:
> Hoping someone can help me here. I'm working with someone else's code and
> I'm not familiar with ereg_replace(), can someone provide me an alternative
> to the following?
>
> ereg_replace("[^a-z0-9._]", "",
> ereg_replace (" ", "_",
> ereg_replace(
only letters and space ?
if (eregi("^[A-Z ]+$", $firstname))
this will return true only if a case-insensitive string will contain only
letters and spaces... (and the string must not be NULL)
if (eregi("^([A-Z]+( )*[A-Z]+)$", trim($firstname)))\
this will return "Maxim Maletsky", " Maxim Male
On 31 Mar 2001 21:07:59 -0800, Michael Hall <[EMAIL PROTECTED]> wrote:
>
>I'm using the following expression to check input strings:
>
>if (!ereg("^[[:alnum:]_-]+$", $string)) { get outta here! }
>
>This works fine except for when a string has spaces, as in text. What do I
>need to add to the expr
At 9:47 PM -0800 3/31/01, Chris Adams <[EMAIL PROTECTED]> wrote:
>On 31 Mar 2001 21:07:59 -0800, Michael Hall <[EMAIL PROTECTED]> wrote:
>>
>>I'm using the following expression to check input strings:
>>
>>if (!ereg("^[[:alnum:]_-]+$", $string)) { get outta here! }
>>
>>This works fine except for
You could try fgets from the fp instead of fread. Then for each line depending
on how well structured it is you have a variety of options, but i think this
would be at least a good start:
www.php.net/preg_split - split on multiple spaces - \s+
jack
Ben Quinn wrote:
> Hi all
>
> Say i had text s
use MSIE:[56|5\..|6\..] something like that, i suck at regular expression :D
- Original Message -
From: "Matthew Delmarter" <[EMAIL PROTECTED]>
To: "PHP Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, October 01, 2001 1:32 PM
Subject: [PHP] ereg
> How do I use ereg to check for MSIE 5.5
This is a good starter about PHP and regular expressions.
http://www.phpbuilder.com/columns/dario19990616.php3
>- Original Message -
>From: "Valentin V. Petruchek" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Monday, December 03, 2001 6:35 PM
>Subject: [PHP] ereg help
>
>
>> I'm
Something like this will work:
eregi("^id \{([a-z]*),([a-z]+),([a-z]+)\} \[(.+)\]$", $str, $regs);
$regs will be an array containing:
[0] => "id {name,title,nick} [http://www.php.net]";
[1] => "name"
[2] => "title"
[3] => "nick"
[4] => "http://www.php.net";
If course this isn't very foolproof
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Janet Valade) wrote:
> if (!ereg("^[0-9\-\+\.\ \)\(]{10,}$",$value)) {
>
> Can anyone tell me why this works for every character except the -. It
> doesn't see the hyphen as a valid part of the phone number, even though it
> recognizes the oth
the - needs to be immediately after the [ to include that character.
Otherwise it is a range indicator.
Charlie
- Original Message -
From: "CC Zona" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 14, 2001 12:56 PM
Subject: Re: [PHP] ereg
>
> Sent: Wednesday, February 14, 2001 12:56 PM
> Subject: Re: [PHP] ereg problem
>
>
> > In article <[EMAIL PROTECTED]>,
> > [EMAIL PROTECTED] (Janet Valade) wrote:
> >
> > > if (!ereg("^[0-9\-\+\.\ \)\(]{10,}$",$value)) {
> > >
Thank you. That was exactly the problem.
Janet
> -Original Message-
> From: Charlie Llewellin [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, February 14, 2001 11:00 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] ereg problem
>
> the - ne
- hyphen is something a bit special in RegEx ..
read the manual, I think you should escape it.
Cheers,
Maxim Maletsky
-Original Message-
From: Janet Valade [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 15, 2001 3:21 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] ereg problem
I am
In article <[EMAIL PROTECTED]>,
"Janet Valade" <[EMAIL PROTECTED]> wrote:
if you include a hyphen in a character class, it must be the
last entry in the range, otherwise it is interepreted as the
range separator.
[0-9+.\()-]
is what you want (probably have to escape some of the
chars above).
print preg_replace('/(.*?)(\w{2})(.*)/', '\\2', $blah);
works for:
$blah = "*9 scott 777zxsdf";
and
$blah = "scott";
> -Original Message-
> From: Jerry Lake [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] ereg issues
>
> I'm feeling a bit stupid today
> how do I truncate a string to the
>
isn't a \w a word character, meaning a-zA-Z_0-9 (in perl)?
if so, that wouldn't match the a-zA-z he originally intended...
am i missing something?
-jack
"..s.c.o.t.t.. [gts]" wrote:
>
> print preg_replace('/(.*?)(\w{2})(.*)/', '\\2', $blah);
>
> works for:
>
> $blah = "*9 scott 777zxsdf";
> a
oh yeah. sorry...
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jack
> Dempsey
> Sent: Thursday, May 10, 2001 3:15 PM
> To: ..s.c.o.t.t.. [gts]
> Cc: Php-General
> Subject: Re: [PHP] ereg issues
>
>
> isn't
; Dempsey
> > Sent: Thursday, May 10, 2001 3:15 PM
> > To: ..s.c.o.t.t.. [gts]
> > Cc: Php-General
> > Subject: Re: [PHP] ereg issues
> >
> >
> > isn't a \w a word character, meaning a-zA-Z_0-9 (in perl)?
> > if so, that wouldn't match
: scott [gts]
Cc: Php-General
Subject: Re: [PHP] ereg issues
print preg_replace('/^(.*?)([a-zA-Z]{2})(.*)/','\\2',$blah);
try that
-jack
"scott [gts]" wrote:
>
> oh yeah. sorry...
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mai
lt;[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 24, 2001 1:19 AM
Subject: Re: [PHP] ereg questions
> On Thu, 24 May 2001 01:01:16 +0800, Ker Ruben Ramos
> ([EMAIL PROTECTED]) wrote:
> >How do i change all '' to ' >href="file.php?file=anything
" ? i mean.. something like it got
> lots of subdirectories or not.
>
> Thanks
> - Original Message -
> From: "Mark Maggelet" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, May 24, 2001 1:19 AM
> Subject: Re: [PHP] ere
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, May 24, 2001 5:18 PM
Subject: Re: [PHP] ereg questions
> Previously, Ker Ruben Ramos said:
> > hmm, got a little question.
> > 1. what's that \\1 and \\2? got any info on where u got that from?
>
> Expands t
In article <002e01c0e46c$ec2459a0$6e00a8c0@webdesign>,
[EMAIL PROTECTED] ("Jay Paulson") wrote:
> echo ereg("^[a-zA-Z]$", $fname);
>
> as you can see I'm just looking to make sure the variable $fname just has
> characters a-zA-Z and nothing else.
Actually, you're checking whethere the variabl
Hello,
check it in the manual: http://www.php.net/manual/en/function.ereg.php
If you don't pass the third -- optional -- argument, then it's true.
Otherwise not.
I don't know this book, but you may keep in my mind that PHP is evolving,
so the online manual can be its most up-to-date documentati
try: eregi_replace("this","that","This equals this equals tHis");
-Original Message-
From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 3:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] ereg et all
hi,
is there a simple way to replace an occu
that is not what I meant... I want the cases to remain...
- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "'Edward van Bilderbeek - Bean IT'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002
riginal Message -
>From: "Rick Emery" <[EMAIL PROTECTED]>
>To: "'Edward van Bilderbeek - Bean IT'" <[EMAIL PROTECTED]>;
><[EMAIL PROTECTED]>
>Sent: Thursday, January 31, 2002 10:47 PM
>Subject: RE: [PHP] ereg et all
>
>
&
ECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002 10:56 PM
Subject: Re: [PHP] ereg et all
> I'm not sure why you wanted the last word "tHis" to be changed to "That"
> (with a capital)... can you explain further?
>
> Jeff
>
> At 10:52 PM
ltren" <[EMAIL PROTECTED]>
>To: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]>;
><[EMAIL PROTECTED]>
>Sent: Thursday, January 31, 2002 10:56 PM
>Subject: Re: [PHP] ereg et all
>
>
> > I'm not sure why you wanted the last word "tHi
t; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002 11:06 PM
Subject: Re: [PHP] ereg et all
> Ahhh, ok makes more sense now. Although, I don't think that there is an
> "easy" way to do what you are asking. I think that in order to accomplish
>
if ((int($string)==($string)) && ($string>0)) {then positive integer}
not sure exactly, but try
Valentin Petruchek (aki Zliy Pes)
*** Cut the beginning ***
http://zliypes.com.ua
mailto:[EMAIL PROTECTED]
- Original Message -
From: "B. Verbeek" <[EMAIL PROTECTED]>
To: "Php-Db-Help (E-mail)
> if ((int($string)==($string)) && ($string>0)) {then positive integer}
>
> not sure exactly, but try
Why not use the RE's? I usually use preg_* so I'll give the example
using these...
if (preg_match ("/^\d+$/", $string)) {
print ("Yep... Only digits.");
} else {
prnt ("Noop! There are no
ruary 12, 2002 6:22 AM
> To: [EMAIL PROTECTED]
> Cc: PHP
> Subject: Re: [PHP] ereg-digits only...
>
>
> if ((int($string)==($string)) && ($string>0)) {then positive integer}
>
> not sure exactly, but try
>
> Valentin Petruchek (aki Zliy Pes)
&
ECTED]
- Original Message -
From: "Daniel Kushner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc: "PHP" <[EMAIL PROTECTED]>
Sent: Tuesday, February 12, 2002 4:00 PM
Subject: RE: [PHP] ereg-digits only...
> That would
On Tue, 2002-02-12 at 03:04, B. Verbeek wrote:
>
> How do I check a string for it to only contain numbers?
>
> >>
>
> if(!ereg("([0-9]+)",$string)){
>
> print "It contains characters other than numbers";
>
> }else{
>
> print "Only numbers";
>
> }
>
> <<
>
> Can anyone give
There's a code section at zend.com. I noticed someone
wrote an email check routine that checks for all
domains and the correct format. You might try there.
rm
--- "W.D." <[EMAIL PROTECTED]> wrote:
> I'm testing email address, but want to test not only
> characters but the @
> sign and for .co
g|tv)/", $email);
- Original Message -
From: "richard merit" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 20, 2001 3:06 PM
Subject: Re: [PHP] ereg match problem
> There's a code section at zend.com. I noticed someone
> wrote an email check r
Try this,
while ($file_name = readdir($dir2)) {
if ($file_name!="." && $file_name!=".." && $file_name!="head.jpg" &&
!ereg(^tn_,$file_name)) {
$files[]=$file_name;
}
}
$numfiles = count($files);
for ($i=$g; $i<$numfiles; $i++){
echo $files[$i];
}
Tom
At 09:45 PM 7/14/01 -0400, you wrote:
>
Hi Lara,
The problem isn't with the if(ereg) line, its the line above.
Put a semi-colon at the end of your $string = "..[snip].." line
Cheers
- -- - - -
Philip Murray - Senior Systems Engineer
[EMAIL PROTECTED] - Open2View.com
http://www.open2view.com
-
ake it easier? not for me :-)
Greets,
Edward
- Original Message -
From: "Jeff Sheltren" <[EMAIL PROTECTED]>
To: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002 11:06 PM
Subject: Re: [PHP] er
ase,
> the 's should be put around it...
>
> does that make it easier? not for me :-)
>
> Greets,
>
> Edward
>
>
> - Original Message -
> From: "Jeff Sheltren" <[EMAIL PROTECTED]>
> To: "Edward van Bilderbeek - Bean IT" <
;
> > does that make it easier? not for me :-)
> >
> > Greets,
> >
> > Edward
> >
> >
> > - Original Message -----
> > From: "Jeff Sheltren" <[EMAIL PROTECTED]>
> > To: "Edward van Bilderbeek - Bean IT" <[EM
IT" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002 11:20 PM
Subject: Re: [PHP] ereg et all - new question..
> Seems like that makes it a LOT easier.
>
> Use eregi_relace() instead of ereg_replace(). eregi allows for
> case-insensitivity.
>
&
otta look for it again
> :-)
>
> Thanks,
>
> Edward
>
> - Original Message -
> From: "Richard Crawford" <[EMAIL PROTECTED]>
> To: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday,
if(!preg_match("/^\d+$/",$string){
echo "$string has something other than a number";
}
-Original Message-
From: Chris Aitken [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 04, 2001 9:34 PM
To: PHP General Mailing List
Subject: [PHP] ereg checking if its only numbers
Ive bee
To: Chris Aitken; PHP General Mailing List
> Subject: RE: [PHP] ereg checking if its only numbers
>
>
> if(!preg_match("/^\d+$/",$string){
> echo "$string has something other than a number";
> }
>
> -Original Message-
> From: Chris Aitken
try:
There is a great book on regular expressions by o'reily.
Evan
*** REPLY SEPARATOR ***
On 10/5/01 at 11:33 AM Chris Aitken wrote:
>Ive been playing around with ereg for about half an hour and having no
>joy
>because I dont really understand the medhod behind it and how
http://php.net/is_numeric
On Fri, 5 Oct 2001, Chris Aitken wrote:
>
> Ive been playing around with ereg for about half an hour and having no joy
> because I dont really understand the medhod behind it and how it all works.
> But what im trying to do is check to see if a 9 digit string is all num
That's not regexps Rasmus! :)
I always see you referring us the the manual! sometimes you refer to a
function i never say in my life! ;)
"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> http://php.net/is_numeric
>
> On Fri, 5 Oct 2001, Chris Ait
Do you have in your .inc file?...
- Original Message -
From: Ted Goranson <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Saturday, January 13, 2001 12:35 AM
Subject: [PHP] ereg works in .php, not in .inc
> Friends--
>
> I have a script that processes another script for display. I ch
Someone gave me the preg_match equivalent
preg_match( '/([-_a-z]+)\.([a-z]+)$/i', $row['site'], $match2 );
I tried that and it took care of the problem, as far as I can tell.
To me, that narrows it down to a problem (bug?) with ereg... anyone else
have any ideas?
---John Holmes...
> -Ori
60 matches
Mail list logo