On Tue, Jul 08, 2003 at 06:47:26AM -0500, Wendell Brown wrote:
>
> I think this would do better...
>
> if( preg_match( "/P[\. ]*O\.* +BOX/i", $address ) )
Unless preg_match does something non-standard, you don't need to escape
a period that's inside square brackets. In fact, the regexp you've
Thanks Wendell. This is exactly what I was looking for.
-Original Message-
From: Wendell Brown [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 4:47 AM
To: PHP General Mailing List
Subject: Re: [PHP] Regular Expression
On Mon, 07 Jul 2003 21:59:23 -0700, Ralph Guzman wrote:
&g
On Mon, 07 Jul 2003 21:59:23 -0700, Ralph Guzman wrote:
>I have a form where I have to check whether user is submitting a PO Box
>as an address. I wrote the following using eregi, but it returns true
>even when the field is not Po Box. How do I go about doing this
>properly?
>
>if(eregi("^Po Box$"
I read your regex as
-match start of line
-followed by p, followed by o
=followed by single space
-followed by b,o,x
-followed by end of line
If someone puts in PO BOX 343, then your regex will not match.
If someone puts in PO BOX 12, then your regex will not match.
If you're saying that you
Hi,
That might actually be a good solution for another item I'm working with.
Thanks for the tip.
-Dan Joseph
> -Original Message-
> From: Jay Blanchard [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 01, 2003 10:10 AM
> To: Dan Joseph; [EMAIL PROTECTED]
&g
[snip]
That would have been my first choice also, however, with the #
and - being
legal, things like ctype_alnum and others don't work out.
[/snip]
Here is an example of something that I did before;
$alphachar = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$ld1alpha = strspn($
Hi,
> You're only checking for valid characters at the *start* of the
> string, you
> need to check to the *end* of the string as well:
>
> "^[A-Za-z0-9 #-]{1,20}$"
>
> ought to do it.
It sure did do it. Thank you! I didn't realize that the $ did that.
Thanks for the info.
-Dan Josep
On Tuesday 01 July 2003 21:38, Dan Joseph wrote:
> Hi Everyone,
>
> I am currently using this piece of code to validate wether or not an
> address has only letters, numbers, #, or - in it:
>
> if (!ereg("^[A-Za-z0-9 #-]{1,20}", $_POST["address1"])) {
> $error = 1;
>
Hi,
> It's not so much that your regex is wrong, but there are other functions
> that you may want to use, such as is_numeric(), is_integer(),
> is_string() (there is a good example of checking for an alphabetic
> string on the php site)
That would have been my first choice also, however,
[snip]
I am currently using this piece of code to validate wether or
not an
address has only letters, numbers, #, or - in it:
if (!ereg("^[A-Za-z0-9 #-]{1,20}", $_POST["address1"])) {
$error = 1;
$msg .= "Address must only contain letters, numbers,
Thanks for the response. I found this web page
(http://www.itworld.com/nl/perl/01112001/) right after I submitted my
question. It was great for explaining regexp's greediness.
1lt John W. Holmes wrote:
I have a script that turns certain words into links. That I am having
no problems with, it
> I have a script that turns certain words into links. That I am having
> no problems with, it is when I want to turn the links back in to plain
> text that I am having the problem. Below are my examples. And I know
> my regex is being greedy but I don't know how to stop it from being so
> damn
At 10:49 14-1-03, you wrote:
hi,
i wrote a regular expression to match email adresses:
$text =
preg_replace("/([a-z0-9_]|\\-|\\.)+@([^[:space:]<>]*)([[:alnum:]-])/i", "
href=\"mailto:\\1\";>\\1", $text);
unluckily also things like ftp:[EMAIL PROTECTED] were matched.
so i rewrote it to:
$text =
pr
why don't you just use str_replace ?
I'm a bit useless at regular expressions so i thought i ask.
i need to turn all
[link url=http://www.site.com] link to site [/link]
in a string into html
http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
___
Here is your answer:
http://www.phpbuilder.com/columns/ying2718.php3?page=2
--
Maxim Maletsky
[EMAIL PROTECTED]
"adrian [EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote... :
> I'm a bit useless at regular expressions so i thought i ask.
> i need to turn all
> [link url=http://www.site.com] l
You could exclude the '}' sign from the expression
$content = ereg_replace("\{[^}]*}","",$content);
This should do the trick... i'm not 100% certain about the '[^}]'
expression, but you should find it in any regexp tutorial
regards,
Ewout de Boer
- Original Message -
From: "Brent Bais
How about this one,
$word_search = 'blablabla' ;
echo eregi_replace("($word_search)","\\1",$html) ;
//
- Original Message -
From: "BAROILLER Pierre-Emmanuel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 08, 2002 2:42 AM
Subject: [PHP] regular expression and exact wo
This should help u out...
http://www.php.net/manual/en/pcre.pattern.modifiers.php
On Thu, 2002-11-07 at 18:29, BAROILLER Pierre-Emmanuel wrote:
> I work with
> preg_match_all to get all matching words
> and preg_replace_callback to replace found sentences...
>
> before runing the
I work with
preg_match_all to get all matching words
and preg_replace_callback to replace found sentences...
before runing the php pass, I take results from a mysql table
with a query like this : select * from mytable where content REGEXP
'[[:<:]]theword[[:>:]]
But... I can't get al
Which functions are you using to do the regex stuff...
That might help...also check out...
On Thu, 2002-11-07 at 15:42, BAROILLER Pierre-Emmanuel wrote:
> Hi!
>
> does someone know how to find an exact word in a content with html tags ?
> I'm using a regexp like this :
>
> $searchRegEx = "'\b
Try looking for search engine scripts - they have this feature very
simple.
--
Maxim Maletsky
[EMAIL PROTECTED]
"BAROILLER Pierre-Emmanuel" <[EMAIL PROTECTED]> wrote... :
> Hi!
>
> does someone know how to find an exact word in a content with html tags ?
> I'm using a regexp like this :
>
>
As someone else mentioned, filenames with embedded spaces can be
confusing and should be avoided where possible (in the future, I'd
replace the space with an underscore _). However, the following will
do what you want (untested):
$regs = preg_split('/\w+/', $dirline, 9);
$regs[8] will contain
At 07:33 07.11.2002, Salman said:
[snip]
>ereg("([-d])[rwxst-]{9}.* [0-9]* [a-zA-Z]+ [0-9: ]* (.+)",$dirline,$regs);
>
>This regular expressions parses the following line:
>
>drwxrwxrwx 1 ownergroup 0 Nov 5 23:19 fantasy
>
>to return: fan
It might, you should test it to find out.
John Meyer wrote:
I've got a regexp:
(EV[0-9]{2})!([0-9]{4}-[0-9]{2}-[0-9]{2})!(GR[0-9]{2}).txt
My question is, will it match this:
EV01!2002-11-09!VR01!GR01.txt
And anything formatted like this: (EV02, and so forth).
--
PHP General Mailing L
if(ereg("<",$string))
{ echo "bad string"; }
else
{ echo "good string"; }
If you're trying to do some HTML filtering, there are better ways to do
it.
---John Holmes...
> -Original Message-
> From: Ns_Andy [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 14, 2002 5:27 AM
> To: [EMAIL P
Hi Ns_Andy,
Monday, October 14, 2002, 1:27:06 PM, I've got:
N> if I want eregi to return false if the string contains < char,
N> for example,
N> "A what's the reg expression I can use?
eregi will return false if there is no such expression;
For Your example it will be:
eregi ("^[^<]+$","Amailt
(For the archives)
The RegEx I finally used was this:
search:
(.*)
replace:
\1
I tried this in 3 editors: jEdit, eMacs and BBEdit
jEdit interpreted the replace expression as literally "\1"
eMacs didn't like the parenthesis in the search string
In BBEdit it worked like a charm.
Not sure why. Pe
> -Original Message-
> From: John W. Holmes [mailto:[EMAIL PROTECTED]]
> Sent: 01 October 2002 02:21
> To: 'Daren Cotter'; 'PHP General Mailing List'
>
> > City: Just ' ??
>
> I'd allow space and period, too, for "Ft. Gordon" for example.
>
> "^[-a-zA-Z0-9' .]+$"
Well, there's an Engl
> What about foreign names...such as the umlaut in
> German? I'm not interested in allowing ALL of the
> characters, just the most common ones...I'd hate to
> restrict a genuine registration because the name
> contains an unaccepted character. Know what I mean?
Well, that wasn't in your original
John,
What about foreign names...such as the umlaut in
German? I'm not interested in allowing ALL of the
characters, just the most common ones...I'd hate to
restrict a genuine registration because the name
contains an unaccepted character. Know what I mean?
--- "John W. Holmes" <[EMAIL PROTECTED
> I need a regular expression to verify various inputs
> on my form. I know the base case of:
>
> "^[a-zA-Z0-9]+$"
>
> matches any letter or number. I'm looking for various
> input from the list as to what characters should be
> allowed in the following fields:
>
> Name: I would think -, ', and
On Fri, 2002-09-27 at 16:53, John Holmes wrote:
This isn't accurate enough because is not always preceeded by:
some text. It is sometimes preceeded by some text or
other items.
This expression matches fairly well:
[a-zA-Z0-9\.,'\-\s]*
So it matches up to the :
A whole bunch of text
> I have a fairly large html document that I need to convert to xml.
> The current format is is:
> A whole bunch of text
>Something else
> (There is a new line in there before )
>
> Which I need to convert to
> A whole bunch of text
>Something else
$new_text = str_replace("\
On Wed, Jul 17, 2002 at 04:03:02PM +0200, Michal Albrecht wrote:
> Andrey Hristov wrote:
>
> >$your_string = preg_replace('/[\d\w]+@([\w\d]{3,}\.)+([\w]{2,4})/','',
>
> Thank you very much for your time, but this strips the e-mail address
> and lives the domain. Could you give me some hints on h
Andrey Hristov wrote:
> Something like this.
> $your_string = preg_replace('/[\d\w]+@([\w\d]{3,}\.)+([\w]{2,4})/','',
> $your_string);
>
> HTH
>
> Best regards,
> Andrey Hristov
Thank you very much for your time, but this strips the e-mail address
and lives the domain. Could you give me some h
Something like this.
$your_string = preg_replace('/[\d\w]+@([\w\d]{3,}\.)+([\w]{2,4})/','',
$your_string);
HTH
Best regards,
Andrey Hristov
- Original Message -
From: "Michal Albrecht" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 1:08 PM
Subject: [PHP] Regu
On Wednesday 17 July 2002 20:07, Henry wrote:
> Hi All,
>
> I'm looking for a simple was to correct a list of proper nouns given all in
> lower case!
>
> For example
>
> given $string="london paris rome";
>
> I would like "London Paris Rome".
>
> However there is one cavet; if the word already has
- don't use /^ .. $/ if you want to replace all occurences. ^ and $ refer
to the very start and end of the whole string
and make no sense at all - at least in this case. your regexp will not
match at all unless $var contains only a
single variable and nothing more
- either capture (somethin
On Wednesday 03 July 2002 01:59, Martin Clifford wrote:
> Even this:
>
> $output = preg_replace("/^[\$]{1,2}[a-zA-Z][0-9]+$/", "\\1", $var);
> echo $output;
>
> Doesn't work. It just takes whatever you put into $var, then puts it into
> $output, and outputs it to the screen.
>
> I want to change
On Tuesday, July 2, 2002, at 01:40 PM, Martin Clifford wrote:
> I'm trying to get this darn eregi_replace() to work, but it doesn't
> produce any results at all.
>
> I want it to find all occurances of PHP variables. Here is the regexp
>
> $output = eregi_replace("^[\$]{1,2}[a-zA-Z][0-9]+$",
Even this:
$output = preg_replace("/^[\$]{1,2}[a-zA-Z][0-9]+$/", "\\1", $var);
echo $output;
Doesn't work. It just takes whatever you put into $var, then puts it into $output,
and outputs it to the screen.
I want to change anything resembling a PHP variable, i.e. $var, $$var or &$var to
$var
On Wednesday 03 July 2002 01:40, Martin Clifford wrote:
> Hey all!
>
> I'm trying to get this darn eregi_replace() to work, but it doesn't produce
> any results at all.
>
> I want it to find all occurances of PHP variables. Here is the regexp
>
> $output = eregi_replace("^[\$]{1,2}[a-zA-Z][0-9]+$
Lance:
On Sun, Jun 16, 2002 at 03:19:39PM +0800, Lance wrote:
>
> its because the html text is from user input.
So, you're going to run eval() on user supplied input? Now THAT's
scarry.
I strongly urge you to rethink what you're doing.
--Dan
--
PHP classes that make web des
hi dan,
its because the html text is from user input. and i dont wanna spend too
much time educating them on coding with php. sometime its a pain trying
to get them to understand the codes. so i just wanna give them some
simple commands in php whereby they can happily insert date formats on a
Hi Lance:
On Sun, Jun 16, 2002 at 01:31:45AM +0800, Lance wrote:
>
> i was developing an application that will read in the content of a html
> file. and within this html file contains php variables which will be
> replaced using the eval() function with its required value. and within
> this h
hi,
i was developing an application that will read in the content of a html
file. and within this html file contains php variables which will be
replaced using the eval() function with its required value. and within
this html, i want to be able to run php functions. however, due to the
fact t
Hi Lance:
On Sat, Jun 15, 2002 at 06:54:24PM +0800, Lance wrote:
> hi, thanks for the code. i tried. it only worked if the string is simply
> the one i wanna convert. but that particular string is in the middle of
> a long text, and there are multiple occurance, it won't.
Strange. It should w
hi, thanks for the code. i tried. it only worked if the string is simply
the one i wanna convert. but that particular string is in the middle of
a long text, and there are multiple occurance, it won't.
however, i did manage to come up with this code that worked. but i
believe it can be improve
Lance:
On Fri, Jun 14, 2002 at 11:41:34PM +0800, Lance wrote:
>
> [::word1 \" word2 \" word3::]
> to:
> ".word1 " word2 " word3."
While I don't know if this is really what you need, it does do exactly
what you want to do in your example:
$Replace['\\'] = '';
$Replace['::'] = '.';
> While I try and request for a recompile of the system, is there an
> alternate way out?
Why don't you use the PCRE functions instead.
The equivalent preg would be:
preg_match("/__([a-z0-9_]+)__/i", "Hello __WO_RD__ Test", $Matches)
> By the way, what is the significance of the switch --wit
Regards,
Sharat
>From: Rasmus Lerdorf <[EMAIL PROTECTED]>
>To: Sharat Hegde <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED], <[EMAIL PROTECTED]>
>Subject: Re: [PHP] Regular Expression Problem continues
>Date: Thu, 28 Mar 2002 11:40:41 -0800 (PST)
>
>In your config
gt;From: Miguel Cruz <[EMAIL PROTECTED]>
> >To: Sharat Hegde <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: [PHP] Regular Expression Problem continues
> >Date: Thu, 28 Mar 2002 12:51:44 -0600 (CST)
> >
> >Works for me in 4.1.1 (and 4.1.
.byronholidays.com/inikatest/testereg.php
To check the PHP version on the server, you can run
http://www.byronholidays.com/inikatest/checkenv.php3
Regards,
Sharat
>From: Miguel Cruz <[EMAIL PROTECTED]>
>To: Sharat Hegde <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re:
Rasmus Lerdorf <[EMAIL PROTECTED]>
> >To: Sharat Hegde <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: [PHP] Regular Expression Problem continues
> >Date: Thu, 28 Mar 2002 02:33:16 -0800 (PST)
> >
> >This code works fine:
>
not work with PHP Version 4.1.1. That is where I have a problem.
>
> With Regards,
> Sharat
>
> >From: Rasmus Lerdorf <[EMAIL PROTECTED]>
> >To: Sharat Hegde <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: [PHP] Regular Expression P
Rasmus,
The code worked fine in PHP Version 3.x
It does not work with PHP Version 4.1.1. That is where I have a problem.
With Regards,
Sharat
>From: Rasmus Lerdorf <[EMAIL PROTECTED]>
>To: Sharat Hegde <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re: [PHP] Re
This code works fine:
eregi("__([a-z0-9_]+)__", "Hello __WO_RD__ Test", $Matches);
echo $Matches[1];
produces:
WO_RD
-Rasmus
On Thu, 28 Mar 2002, Sharat Hegde wrote:
> Hello,
>
> I am still having problems with the regular expressions. Looks like there
> has been a change in the way they are
Very nice. I was going to suggest:
But uhhh, your way is much nicer :]
- Original Message -
From: "Richard Archer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 26, 2002 4:04 AM
Subject: Re: [PHP] Regular Expression Challenge
> At 11:30
At 11:30 AM +1000 26/3/02, Cameron Just wrote:
>I was not sure as to whether regexp could do recursive matching and now I
>know.
This is crazy! There used to be clue on this list!
\n";
}
}
?>
Output:
$tok[0] = wed
$tok[1] = thurs
$tok[2] = 9:35
$tok[3] = 14:56
$tok[4] = 18:35
$tok[5]
Sent: Tuesday, March 26, 2002 1:01 AM
Subject: Re: [PHP] Regular Expression Challenge
> You won't be able to do that with a regexp alone. Recursively matching
> isn't possible. You'll need a little help from some additional code.
>
> $string = "wed-thurs 9:3
Brilliant. (Sort of)
Thats the answer I needed thankyou.
I was not sure as to whether regexp could do recursive matching and now I
know.
Thankyou for your help.
> You won't be able to do that with a regexp alone. Recursively matching
> isn't possible. You'll need a little help from some addit
You won't be able to do that with a regexp alone. Recursively matching
isn't possible. You'll need a little help from some additional code.
\n" . $matches[2] . "\n" );
while( list( $key, $val ) = each( $times ) ){
print( trim( ${val} ) . "\n" );
}
?>
That seems
No luck on any of those suggestions people but thanks anyway :(
I had a feeling it was a bit too complex for a regexp.
> Oh, I didnt read the bit at the bottom about the times appearing any
> number of times. Off the top of my head I think this should work...
>
> PREG:
>
> "/'([a-z]+)-([a-z]+
Oh, I didnt read the bit at the bottom about the times appearing any number
of times. Off the top of my head I think this should work...
PREG:
"/'([a-z]+)-([a-z]+)\s(?:([0-9]+(?::[0-9]+|))(?:,\s)?)*'/"
--
Matt
- Original Message -
From: "Cameron Just" <[EMAIL PROTECTED]>
To: <[EMAIL P
Why a regexpr?
Do one explode() on the " "
Clean up the commas from the elements [1],[2] & [3] of the returned array
and on element[0] do an additional explode on "-"
cheers,
--t.
On Mon, 25 Mar 2002, Cameron Just wrote:
> Hi,
>
> I am trying to pull out the following information via a regula
__([a-z0-9][a-z0-9_]+)__
-Original Message-
From: Sharat Hegde [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 4:22 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Regular Expression Problem
Hello,
In PHP3, I am using code which using the regular expression capability of
PHP. The code
Kris Vose wrote:
>
> How would you write a regular expression that defines a phone number: ex.
>(123)123-1234.
>
> In other words how would you check to see if there were three numerics surrounded by
>(), then
> three numerics with a "-", then four numerics.
with posix regular expression, fo
On Tue, 19 Mar 2002, Kris Vose wrote:
> How would you write a regular expression that defines a phone number: ex.
>(123)123-1234.
>
> In other words how would you check to see if there were three numerics surrounded by
>(), then three numerics with a "-", then four numerics.
>
>
> This is
On Wednesday 20 March 2002 01:53, Thalis A. Kalfigopoulos wrote:
> I guess you can do it also as:
>
> ([1-9]{3})[1-9]{3}-[1-9]{4}
But wouldn't this excludes zeros?
Try:
preg_match("/^\(\d{3}\)\s\d{3}-\d{4}$/", $number)
which matches
(123) 345-6789
--
Jason Wong -> Gremlins Associates ->
I guess you can do it also as:
([1-9]{3})[1-9]{3}-[1-9]{4}
cheers,
--t.
On Tue, 19 Mar 2002, Kris Vose wrote:
> How would you write a regular expression that defines a phone number: ex.
>(123)123-1234.
>
> In other words how would you check to see if there were three numerics surrounded b
Try this... it should only print out "Some webpage data"
$text = "
script data.
Some webpage data
another script data
";
print preg_replace('/(.*?)<\/script>/',
'', $text);
Ando Saabas wrote:
> Ok let me explain my problem further some. I need the regular expression to
> purify the html pa
At 05:52 PM 3/14/2002 +0200, Ando Saabas wrote:
>Ok let me explain my problem further some. I need the regular expression to
>purify the html page from script tags:
>I used: $file = eregi_replace("(.*)", " ", $file);
>Now this works fine, until theres a webpage like:
>
>script data.
>Some webpage
Ok let me explain my problem further some. I need the regular expression to
purify the html page from script tags:
I used: $file = eregi_replace("(.*)", " ", $file);
Now this works fine, until theres a webpage like:
script data.
Some webpage data
another script data
so the regexp above replaces
the best you can do is:
-Original Message-
From: Ando Saabas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 14, 2002 9:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP] regular expression for (NOT 'word')
how would i build a regular expression in php that would match
everything but the giv
I apologize for the repeats. As I mentionned before, I've been having
problems with this list. I believe everything is working fine, now.
-john
On Thu, 3 Jan 2002, Jim Lucas [php] wrote:
> I have seen this question reposted for the past week. now why don't you
> just work with the entire th
You can do as Jim says here or go back and read the manual section again
for eregi and ereg. What you're trying to do should be written more like
this:
';
$numMatches = eregi('()',$str,$results);
print("numMatches: $numMatches \n");
print("body contents: $results[2] \n");
print("all results: ")
I have seen this question reposted for the past week. now why don't you
just work with the entire thing.
get the ""
now once you have that, do this
$str = preg_replace("", "", $str)
now your $str var will only have the properties.
Jim
- Original Message -
From: "[-^-!-%-" <[EMAIL PRO
* John Monfort ([EMAIL PROTECTED]) [Dec 31. 2001 11:30]:
> I'm using regular expression to extract all text within the tag.
> With a BODY tag like
>\\only interested in this line.
[...]
> echo "$out[0]";
> However, this prints everything following (and including) the ' portion of the BOD
a search
engine.
Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948
-Original Message-
From: Wakan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 19, 2001 10:21 AM
To: Darren Gamble
Subject: RE: [PHP] reg
Good day,
The problem here is with the .* expression, which matches any character,
including > . The regex is "greedy" and will try and match as much as it
possibly can.
What you could do is change it so that it doesn't match > . Then, the >
will be matched later in the expression,, as you wan
Sent: Tuesday, November 13, 2001 10:18 AM
Subject: Re: [PHP] Regular Expression
> I am just learning them, but I think something like this may be in order...
> I know that you would use the | (or) operator.
>
> if(! (ereg('^[a-z|A-Z|0-9|\-]+$', $fn) && (ereg('
I am just learning them, but I think something like this may be in order...
I know that you would use the | (or) operator.
if(! (ereg('^[a-z|A-Z|0-9|\-]+$', $fn) && (ereg('^[a-z|A-Z|0-9|\-]+$', $fs)))
{
Either $fn or $sn failed the match
}
-Jason Garber
IonZoft.com
At 04:41 PM 11/13/
What is $num going to be? A number? So how do you determine where that
number ends and where there shouldn't be another number in front of it...are
there any restrictions on the size of $num?
say $num is 51
then you're saying that you want to match
51::
but not 151::
however, what if $num is 151?
blem. Does having
a filename containing multiple dots (placed in the appropriate directory) contravene
the specification?
=dn
- Original Message -
From: "Christian Reiniger" <[EMAIL PROTECTED]>
To: "Galkov Vladimir" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED
On Thursday 01 November 2001 10:39, Galkov Vladimir wrote:
> Need to remove all "../" "/.." from user inputing string to prevent
> him walking and creating files&directories where I don't whant see
> them/him...
>
> The string:
>
> $path =
> eregi_replace('([..]{2,})|([./]{2})|([../]{3,})|([/
Andrey,
Thanks for the time that you put into this!
After some tweaking (for my scripts) I got this working nicely, and learned
a thing or two about PREG also.
Ross Nielsen
[EMAIL PROTECTED]
"Andrey Hristov" <[EMAIL PROTECTED]> wrote in message
02d801c12f2e$c1a60a90$0b01a8c0@ANDreY">news:02d801
Some time spent to try but now i think it works:
";
$a='datadatadatadata[link1]datadatadata{link2}data[link3]';
// $a='datadata{link1}data[link2]datadatadata{link3}data[link4]';
$pattern='/((\[)|\{)(.+?)(?(2)\]|\})/';
echo $a."\n";
echo $pattern."\n";
preg_match_all($pattern,$a,$matches,PREG
eturns "bcd"
-Original Message-
From: Seb Frost [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 25, 2001 5:09 PM
To: [EMAIL PROTECTED]; PHP
Subject: RE: [PHP] Regular Expression Question
I hope my later message clarifys what I mean.
- seb
-Original Message-
From: Jeff O
I hope my later message clarifys what I mean.
- seb
-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: 25 July 2001 22:05
To: PHP
Subject: RE: [PHP] Regular Expression Question
Aren't the trims just for white space?
Jeff Oien
> since you know exactly
Aren't the trims just for white space?
Jeff Oien
> since you know exactly which 4 characters you want to keep you can use a
> simple string trimming routine. I forget the name of the function in php
> but it's there and it'll be something like
>
> trimstring($string,1,5);
>
> or something like
$newstring = substr($string,1,4);
FOUR, not FIVE. Doh.
-Original Message-
From: Seb Frost [mailto:[EMAIL PROTECTED]]
Sent: 25 July 2001 22:03
To: [EMAIL PROTECTED]; PHP
Subject: RE: [PHP] Regular Expression Question
since you know exactly which 4 characters you want to keep you can
since you know exactly which 4 characters you want to keep you can use a
simple string trimming routine.
$newstring = substr($string,1,5);
No need for complicated regular expressions!
- seb
-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: 25 July 2001 21:47
To: PHP
S
Lazy me, after a short break, alway's helping, I found out wthat it has
to be:
/\<(?!\?xml|\!DOCTYPE|\!ENTITY|image|item|\/item)/
the ?! negate this text, I though that I could put it in every value
like this (?!\?xml|?!\!ENTITY ... but no by putting in first he do it
for all (k.i.s.s. Francis)
try something like this:
$emails = array('[EMAIL PROTECTED]', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]',
'[EMAIL PROTECTED]');
$doms = array(
'domain1.com'=>1,
'domain2.com'=>1,
);
while ( list(,$email) = each($emails) ) {
preg_match('/^([_\.0-9a-z-]+)@(([0-9a-z][0-9a-z-
On Tuesday 22 May 2001 19:44, Jason Caldwell wrote:
> I'm trying to figure out how to "say" with a Regular Expression how to
> check for the following characters in a phone number:
>
> ( ) -
>
> with a length between 1 and 20 --
preg_match ('/^[\d()-]{1,20}$/', $Subject)
should do the trick.
--
On Tue, 22 May 2001 10:44:42 -0700, Jason Caldwell
([EMAIL PROTECTED]) wrote:
>I'm trying to figure out how to "say" with a Regular Expression how
>to check
>for the following characters in a phone number:
>
>( ) -
>
>with a length between 1 and 20 --
>
>I've tried the following and it doesn't see
On Wednesday 18 April 2001 22:55, you wrote:
> >oops. The expression should read '/\[([^\]]+)\]/'
>
> Thanks all, i used this code and it works:
>
> preg_match("/\[(.+)\]/",$msg_array[$i],$segments);
Note: This won't do what you expect, since the ".+" part will match as
much as possible.
On Jue 19 Abr 2001 00:23, Andrew Braund wrote:
> LinuxSA http://www.linuxsa.org.au/ meeting a couple of days ago was
> on regex, some notes are at;
> http://www.fornax.net/regex2/
> or part 1 at;
> http://www.fornax.net/regex/
Isn't there a place with printable versions?
Saludos... :-)
--
El
rsday, 19 April 2001 06:25
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Regular Expression
>
>
>
> >oops. The expression should read '/\[([^\]]+)\]/'
>
> Thanks all, i used this code and it works:
>
> preg_match("/\[(.+)\]/"
>oops. The expression should read '/\[([^\]]+)\]/'
Thanks all, i used this code and it works:
preg_match("/\[(.+)\]/",$msg_array[$i],$segments);
$title = trim($segments[1]);
$description = ereg_replace("\[ $title \]", "", $msg_array[$i]);
Does anyone know a good regex
201 - 300 of 313 matches
Mail list logo