On 7/27/2012 2:56 PM, David Harkness wrote:
On Fri, Jul 27, 2012 at 11:43 AM, Al wrote:
"%[\w\d,.]%"
"\w" will match digits so "\d" isn't necessary, but it will also match
underscores which isn't desired.
David
You're correct, I forgot about the darn _ and \w includes digits
So, how's
On Fri, Jul 27, 2012 at 11:43 AM, Al wrote:
> "%[\w\d,.]%"
>
"\w" will match digits so "\d" isn't necessary, but it will also match
underscores which isn't desired.
David
On 7/27/2012 1:07 PM, Ethan Rosenberg wrote:
Dear list -
I've tried everything and am still stuck.
A regex that will accept numbers, letters, comma, period and no other characters
Thanks.
Ethan Rosenberg
"%[\w\d,.]%"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, v
On 03/05/2011 04:38 PM, Mark Kelly wrote:
> Hi.
>
> Thanks for all the replies.
>
> On Saturday 05 Mar 2011 at 22:11 Simon J Welsh wrote:
>
>> On 6/03/2011, at 11:08 AM, Shawn McKenzie wrote:
>>> $regex = '/"([^"]+)"/';
>
> Shawn, this regex gets me two copies of each string - one with and one
Maybe this will help.
$regex = '/(?<=")[^.]*(?=")/';
$r = preg_match_all($regex, $sentence, $phrases);
Hi.
Thanks for all the replies.
On Saturday 05 Mar 2011 at 22:11 Simon J Welsh wrote:
> On 6/03/2011, at 11:08 AM, Shawn McKenzie wrote:
> > $regex = '/"([^"]+)"/';
Shawn, this regex gets me two copies of each string - one with and one without
the double quotes - as did the one Nathan posted e
On 6/03/2011, at 11:08 AM, Shawn McKenzie wrote:
> On 03/05/2011 09:26 AM, Mark Kelly wrote:
>> Hi.
>>
>> I'm hoping someone can help me extract text between double quotes from a
>> string.
>>
>> $regex = 'some magic';
>> $r = preg_match($regex, $sentence, $phrases);
>>
>> So, if
>>
>> $sen
On 03/05/2011 09:26 AM, Mark Kelly wrote:
> Hi.
>
> I'm hoping someone can help me extract text between double quotes from a
> string.
>
> $regex = 'some magic';
> $r = preg_match($regex, $sentence, $phrases);
>
> So, if
>
> $sentence = 'Dave said "This is it". "Nope, that is the wrong colour
Mark Kelly wrote:
Hi.
I'm hoping someone can help me extract text between double quotes from a
string.
$regex = 'some magic';
$r = preg_match($regex, $sentence, $phrases);
So, if
$sentence = 'Dave said "This is it". "Nope, that is the wrong colour" she
replied.';
I want $phrases to cont
On 1/1/2011 4:46 AM, Lester Caine wrote:
JohnDoeSMITH' or 'John Doe SMITH'
Try this. not tested.
First, which adds spaces as needed. e.g. JohnDoeSMITH > 'John Doe SMITH'
$newName=preg_replace("%(?<=[a-z])([A-Z])", " $1", $name);//Cap following low
case, add space before it
Next, alphas fol
Al wrote:
>
>
> On 12/29/2010 7:12 PM, Ethan Rosenberg wrote:
>> Dear List -
>>
>> Thank you for all your help in the past.
>>
>> Here is another one
>>
>> I would like to have a regex which would validate that a telephone
>> number is in the format xxx-xxx-.
>>
>> Thanks.
>>
>> Ethan
>>
On 12/31/2010 11:10 AM, a...@ashleysheridan.co.uk wrote:
Erm, you say regex is overkill, then use one in your example!
Thanks,
Ash
http://www.ashleysheridan.co.uk
- Reply message -
From: "Al"
Date: Fri, Dec 31, 2010 15:53
Subject: [PHP] Re: Regex for telephone numbers
To:
Erm, you say regex is overkill, then use one in your example!
Thanks,
Ash
http://www.ashleysheridan.co.uk
- Reply message -
From: "Al"
Date: Fri, Dec 31, 2010 15:53
Subject: [PHP] Re: Regex for telephone numbers
To: ,
On 12/29/2010 7:12 PM, Ethan Rosenberg wrote:
&
On 12/29/2010 7:12 PM, Ethan Rosenberg wrote:
Dear List -
Thank you for all your help in the past.
Here is another one
I would like to have a regex which would validate that a telephone number is
in the format xxx-xxx-.
Thanks.
Ethan
MySQL 5.1 PHP 5 Linux [Debian (sid)]
Regex i
Shawn McKenzie wrote:
> Igor Escobar wrote:
>> No no, i need to make an regex to "match" the bold areas in my string.
>> Anything between single quotes or double quotes (including quotes and
>> double quotes). Understand?
>>
>>
>> Regards,
>> Igor Escobar
>> Systems Analyst & Interface Designer
>>
Igor Escobar wrote:
> No no, i need to make an regex to "match" the bold areas in my string.
> Anything between single quotes or double quotes (including quotes and
> double quotes). Understand?
>
>
> Regards,
> Igor Escobar
> Systems Analyst & Interface Designer
>
> + http://blog.igorescobar.com
>
Igor Escobar wrote:
> The solution don't need to be with regex, if anyone can solve this with
> other way will be very helpfull .
>
>
> Regards,
> Igor Escobar
> Systems Analyst & Interface Designer
>
> + http://blog.igorescobar.com
> + http://www.igorescobar.com
> + @igorescobar (twitter)
>
>
The solution don't need to be with regex, if anyone can solve this with
other way will be very helpfull .
Regards,
Igor Escobar
Systems Analyst & Interface Designer
+ http://blog.igorescobar.com
+ http://www.igorescobar.com
+ @igorescobar (twitter)
On Fri, Jul 31, 2009 at 2:23 PM, Igor Esco
Jason Pruim schreef:
On Sep 9, 2008, at 12:18 PM, Jochem Maas wrote:
...
I'll have to do some searching :)
always ;-)
The problem with the internet is there is so much out there... Trying to
weed the crap from the food can be a long digestive process which ends
up with MORE crap comin
On Sep 9, 2008, at 12:18 PM, Jochem Maas wrote:
Jason Pruim schreef:
On Sep 9, 2008, at 5:02 PM, Nathan Rixham wrote:
Jason Pruim wrote:
On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote:
Jason Pruim wrote:
Hey everyone,
Not completely specific to php but I know you guys know
regex's bett
Jason Pruim schreef:
On Sep 9, 2008, at 5:02 PM, Nathan Rixham wrote:
Jason Pruim wrote:
On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote:
Jason Pruim wrote:
Hey everyone,
Not completely specific to php but I know you guys know regex's
better then I do! :)
I am attempting to match purl.sch
On Sep 9, 2008, at 5:02 PM, Nathan Rixham wrote:
Jason Pruim wrote:
On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote:
Jason Pruim wrote:
Hey everyone,
Not completely specific to php but I know you guys know regex's
better then I do! :)
I am attempting to match purl.schreurprinting.com/jaso
Jason Pruim wrote:
>
> On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote:
>
>> Jason Pruim wrote:
>>> Hey everyone,
>>> Not completely specific to php but I know you guys know regex's
>>> better then I do! :)
>>> I am attempting to match purl.schreurprinting.com/jasonpruim112 to
>>> purl.schreurpr
Jason Pruim wrote:
On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote:
Jason Pruim wrote:
Hey everyone,
Not completely specific to php but I know you guys know regex's
better then I do! :)
I am attempting to match purl.schreurprinting.com/jasonpruim112 to
purl.schreurprinting.com/p.php?purl=j
On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote:
Jason Pruim wrote:
Hey everyone,
Not completely specific to php but I know you guys know regex's
better then I do! :)
I am attempting to match purl.schreurprinting.com/jasonpruim112 to
purl.schreurprinting.com/p.php?purl=jasonpruim112
Here
Jason Pruim wrote:
Hey everyone,
Not completely specific to php but I know you guys know regex's better
then I do! :)
I am attempting to match purl.schreurprinting.com/jasonpruim112 to
purl.schreurprinting.com/p.php?purl=jasonpruim112
Here are my current matching patterns:
On Aug 13, 2008, at 4:06 PM, Boyd, Todd M. wrote:
-Original Message-
From: Shawn McKenzie [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 13, 2008 3:31 PM
To: php-general@lists.php.net
Subject: [PHP] Re: regex
Philip Thompson wrote:
Figured it out. Just needed to stretch my brain a
On Aug 13, 2008, at 3:31 PM, Shawn McKenzie wrote:
Philip Thompson wrote:
Figured it out. Just needed to stretch my brain a lil.
On Aug 13, 2008, at 3:07 PM, Philip Thompson wrote:
$pattern = '/(.*).php\?action=([^&]+)+/';
preg_match ($pattern, $subject, $matches);
return $matches;
}
blegh
> -Original Message-
> From: Shawn McKenzie [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 13, 2008 3:31 PM
> To: php-general@lists.php.net
> Subject: [PHP] Re: regex
>
> Philip Thompson wrote:
> > Figured it out. Just needed to stretch my brain a lil.
&g
Philip Thompson wrote:
Figured it out. Just needed to stretch my brain a lil.
On Aug 13, 2008, at 3:07 PM, Philip Thompson wrote:
$pattern = '/(.*).php\?action=([^&]+)+/';
preg_match ($pattern, $subject, $matches);
return $matches;
}
blegh ('somePage.php?action=doSomething&id=');
?>
O
Take a look at this function, it'll make things a little easier:
http://us3.php.net/manual/en/function.parse-str.php
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Philip Thompson wrote:
> Figured it out. Just needed to stretch my brain a lil.
>
> On Aug 13
Figured it out. Just needed to stretch my brain a lil.
On Aug 13, 2008, at 3:07 PM, Philip Thompson wrote:
$pattern = '/(.*).php\?action=([^&]+)+/';
preg_match ($pattern, $subject, $matches);
return $matches;
}
blegh ('somePage.php?action=doSomething&id=');
?>
Ok, the important parts t
VamVan 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
hotmail.com
gmail.com
Thanks
Or if you know that the address is valid
$user = trim(strstr($email, '@'), '@);
VamVan 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
hotmail.com
gmail.com
Thanks
Go here and get charprobe http://www.dextronet.com/charprobe.php It's a super
utility to have.
Look up the hex code for a space, "/x20" as I recall.
Then pick a non-printable code that you like e.g., /x83 or a printable one that
users cannot enter.
Then simply preg_replace("%/x20+%", "/83",
jekillen wrote:
Hello again;
Regarding the error I was inquiring about:
Warning: ereg() [function.ereg]: REG_ERANGE in _proc.php on
line 81
I still would like to know what it means but
I solved the script problem.
I found that since $groups is a string that was exploded to form the
$g_lis
Hello again;
Regarding the error I was inquiring about:
Warning: ereg() [function.ereg]: REG_ERANGE in _proc.php on
line 81
I still would like to know what it means but
I solved the script problem.
I found that since $groups is a string that was exploded to form the
$g_list array
it may ha
Get The Regex Coach http://weitz.de/regex-coach/
Use preg_match_all()
Build your pattern one step at a time using the coach. Don't forget the
delimiters.
jekillen wrote:
Hello;
The following regex:
ereg("id='$m[1]'>", $groups, $m1);
is causing the following error:
Warning: ereg() [functi
M. Sokolewicz wrote:
Nadim Attari wrote:
Hello,
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 text...hre
http://www.php.net/manual/en/reference.pcre.pattern.syntax.php
On 8/22/06, Alex Turner <[EMAIL PROTECTED]> wrote:
If what you mean is a db table, then it would seem to me that you should
not be using a regex. PHP has rawurlencode() for this sort of thing.
But - you should learn regex ;-)
Try
If what you mean is a db table, then it would seem to me that you should
not be using a regex. PHP has rawurlencode() for this sort of thing.
But - you should learn regex ;-)
Try something like (untested and late at night)
function urlme($location)
{
$enc=rawurlencode($location);
$spc
On 21/08/06, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
A little harsh but I agree with the sentiment - plus you will get a lot of
pleasure out of it when you see how powerful a tool it is in your arsenal.
--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk
Nadim Attari wrote:
Hello,
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 text...href="http://www.somethin
On Mon, 21 Aug 2006 13:51:16 +0400, Nadim Attari wrote:
> Hello,
>
> 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 clickabl
John Nichel wrote:
Okay, maybe it's just the fact that I'm concentration on getting out of
here for the holidays more than I am on my work, but I'm pulling my hair
out. Say I have a string -
Now, is the time; for all good men! to come to the aide? of their
What I want to do is drop everythin
Jeffrey Sambells wrote:
I came across this method of matching brackets with regex in .NET
http://puzzleware.net/blogs/archive/2005/08/13/22.aspx
but I am wondering if it is possible to do the same in PHP?
I've tried it a bit but I can't seem to get it to work properly. I'm
just wondering if
Jason Gerfen wrote:
I am having a problem with a couple of function I have written to check
for a type of string, attempt to fix it and pass it back to the main
function. Any help is appreciated.
if( ( eregi(
"^[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[
I don't know if these are equal.
What about \r\n line endings?
And what about \r line endings (from old Macs)?
I guess file() handles all of these cases (didn't test it though)
and your code doesn't (with \r you'll get a one line file!).
AllOlli
--
PHP General Mailing List (http://www.php.net/)
> I am trying to implement a regular expression so that I have a number
> between 0.00 and 1.00. the following works except I can go up to 1.99
>
> $regexp = "/^[0-1]{1}.[0-9]{2}/";
>
You could always do this, unless you are set on using a regular expression:
if($num>=0 && $num<=1.01){
echo numb
RaTT wrote:
Hi Guys,
I am currently creating a once off text parser for a rather large
document that i need to strip out bits of information on certain
lines.
The line looks something like :
"Adress line here, postcode, country Tel: +27 112233665 Fax: 221145221
Website: http://www.urlhere.co
I think there maybe a few ways to do this... One is
[EMAIL PROTECTED]@[EMAIL PROTECTED]
That basically says "find me the pattern where one non-at symbol is followed
by an at symbol followed by another non-at symbol"
So if you do
numMatch: 3
Array
(
[0] => Array
(
[0]
On Fri, 28 Jan 2005 14:59:29 -0700, <[EMAIL PROTECTED]> wrote:
OK, this is off-topic like every other "regex help" post, but I know some
of you enjoy these puzzles :)
I need a validation regex that will "pass" a string. The string can be no
longer than some maximum length, and it can contain any ch
[EMAIL PROTECTED] wrote:
preg_match_all('#\[LEVEL([0-9])\](.*)\[/LEVEL[0-9]]#Uim', $content,
$matches);
You make it look so easy, thanks! That takes care of step one, but how do I
make it so everything in $content where there is a level set, is replaced
with ###LEVEL?###
Does #Uim tell it to only
> preg_match_all('#\[LEVEL([0-9])\](.*)\[/LEVEL[0-9]]#Uim', $content,
$matches);
You make it look so easy, thanks! That takes care of step one, but how do I
make it so everything in $content where there is a level set, is replaced
with ###LEVEL?###
Does #Uim tell it to only get the first [/LEVE
[EMAIL PROTECTED] wrote:
I wish to improve upon my regular expression skills. I am creating a journal
object that allows me to post my journals online, while at the same time
maintaining nine different levels of privacy. For example, if I give a user
Level 3 access, then they would be able to see
> Hi,
>
> I can't answer your regexp question but some
> thoughts on file() etc.:
> - file() returns the contents line by line as an
> array, so this makes only
> sense if you need the contents in this form, e.g.
> for looping through each
> line and applying a function or whatever
> - fread() re
"Php Gen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I am just starting out with regex (and classes) so am
> not sure how to do this...
>
> I am seeing if a HTML file exists, if yes, I am using
> file_get_contents to get the entire HTML file into a
> string.
>
> In the HTML
-Original Message-
From: Fabrice Lezoray [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 01, 2004 2:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: regex help needed
hi
M. Sokolewicz a écrit :
You could try something like:
$return = preg_replace('#(.*)#Uie',
'str_replace(&q
What are 'Uie' and 'sie'?
Thanks again!
Kathleen
-Original Message-
From: Fabrice Lezoray [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 01, 2004 2:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: regex help needed
hi
M. Sokolewicz a écrit :
> You could try so
hi
M. Sokolewicz a écrit :
You could try something like:
$return = preg_replace('#(.*)#Uie', 'str_replace("", "", "$1")');
- Tul
Kathleen Ballard wrote:
Sorry,
Here is the code I am using to match the tags:
.*
I think this mask is better :
`.*?`sie
I have removed all the NL and CR chars from the
You could try something like:
$return = preg_replace('#(.*)#Uie', 'str_replace("", "", "$1")');
- Tul
Kathleen Ballard wrote:
Sorry,
Here is the code I am using to match the tags:
.*
I have removed all the NL and CR chars from the string
I am matching to make things easier. Also, I have run
tidy
Thanks, that's exactly what I was looking for.
-Josh
On Thu, 01 Jul 2004 15:17:41 -0700, Lars Torben Wilson <[EMAIL PROTECTED]> wrote:
>
> Josh Close wrote:
>
> > I'm trying to get a simple regex to work. Here is the test script I have.
> >
> > #!/usr/bin/php -q
> > >
> > $string = "hello\nwor
Josh Close wrote:
I'm trying to get a simple regex to work. Here is the test script I have.
#!/usr/bin/php -q
$string = "hello\nworld\n";
$string = preg_replace("/[^\r]\n/i","\r\n",$string);
First, the short version. You can fix this by using backreferences:
$string = preg_replace("/([^\r])\n/i",
Why do you need to remove the delimeters? If you remove them, then it
makes it quite difficult to get the data you need. If you want to
display the date and race type without the square brackets around them,
then use $matches[0][1] and $matches[1][1] instead of $matches[0][0] or
$matches[1][0
"Karthikeyan"
<[EMAIL PROTECTED]>
Sent: Monday, January 26, 2004 11:56 PM
Subject: [PHP] Re: Regex Help
> Check the PHP manual for preg_match()
> (http://us3.php.net/manual/en/function.preg-match.php).
>
> I did play around with it a little bit, and I think I've got a st
Check the PHP manual for preg_match()
(http://us3.php.net/manual/en/function.preg-match.php).
I did play around with it a little bit, and I think I've got a starting
point for you to work with. Try out this code and then play around with
it to get the results you need. $matches[2][0] will hol
Try this:
$pattern = '#function
(\w+)\(((?:\$\w+(?:,\s*\$\w+)*?)|\s*)\)\s*\{[.\s]*((?:return\s+[^;]*\s*;)|)[
.\s]*#m';
Notice that \w means:
A "word" character is any letter or digit or the underscore character, that
is, any character which can be part of a Perl "word".
Though, any regexp for thi
[EMAIL PROTECTED] schrieb:
My regex skills are serious lacking and after scouring the net for
relevant links I'm a bit stuck. I've got a textarea field where I pull
user input from, and I'd like to search this entire field for a Windows
Directory Path (ex. C:\Documents\Blah).
Basically my users ar
On Fri, 2003-10-10 at 16:18, Curt Zirzow wrote:
> On Fri, 10 Oct 2003 14:01:00 -0400 (EDT), Lists <[EMAIL PROTECTED]> wrote:
>
> > I do not know if this is the right list, but if someone could help me
> > with the following
>
> Sure, I'll be glad to help.
>
>
> > I need a function that does th
On Fri, 10 Oct 2003 14:01:00 -0400 (EDT), Lists <[EMAIL PROTECTED]> wrote:
I do not know if this is the right list, but if someone could help me
with the following
Sure, I'll be glad to help.
I need a function that does this:
I'm not sure if you want me to write the code that does this for you,
You need to escape the period "." twice with backslashes "\\"
--
Jon Kriek
http://phpfreaks.com
"Jonas_weber @ Gmx . Ch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Regular Expressions: How can I indicate that the contents of a term
> (user input*) needs to be treated as 'non-o
o match the last part of the url and looks up untill the end.
Again a string containing no slashes
Hope it does do what I expect it to do .. ;)
Wouter
-Oorspronkelijk bericht-
Van: Merlin [mailto:[EMAIL PROTECTED]
Verzonden: vrijdag 15 augustus 2003 16:21
Aan: [EMAIL PROTECTED]
Onderwer
* Thus wrote Kae Verens ([EMAIL PROTECTED]):
> Jay Blanchard wrote:
> >if($string == 'test/contact.html')
>
> >it could be
> >
> >if($string == "test/contact.html")
>
> not to start a flame war or anything, but isn't the apostrophe version
> quicker, as it doesn't ask the server to parse the str
* Thus wrote Merlin ([EMAIL PROTECTED]):
> ufff.. sorry guys, but I have to explain that better. I appreciate your
> help, maybe I did not give enough info.
>
> I am trying to redirect with apache modrewrite. To do this you have to use
> regex (not if functions:-)
I'm not sure what you expect sin
Good idea,
but does not work either - surprisingly! -
There should be a clean way with regex for this task.
Andy regex expert in here?
Merlin
"Kae Verens" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Merlin wrote:
> > ufff.. sorry guys, but I have to explain that bett
does not work. Is there not a way to exclude the word "partner" like you
triede with !(partner) ?
merlin
"Marek Kilimajer" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> So
> ^[^/]+/[^/]*
>
> or
>
> ^!(partner/)
>
> Merlin wrote:
>
> > ufff.. sorry guys, but I have to expla
So
^[^/]+/[^/]*
or
^!(partner/)
Merlin wrote:
ufff.. sorry guys, but I have to explain that better. I appreciate your
help, maybe I did not give enough info.
I am trying to redirect with apache modrewrite. To do this you have to use
regex (not if functions:-)
My problem is, that there are member
Merlin wrote:
ufff.. sorry guys, but I have to explain that better. I appreciate your
help, maybe I did not give enough info.
I am trying to redirect with apache modrewrite. To do this you have to use
regex (not if functions:-)
My problem is, that there are member accounts which look like that:
me
Jay Blanchard wrote:
if($string == 'test/contact.html')
it could be
if($string == "test/contact.html")
not to start a flame war or anything, but isn't the apostrophe version
quicker, as it doesn't ask the server to parse the string?
Kae
--
PHP General Mailing List (http://www.php.net/)
To unsu
ufff.. sorry guys, but I have to explain that better. I appreciate your
help, maybe I did not give enough info.
I am trying to redirect with apache modrewrite. To do this you have to use
regex (not if functions:-)
My problem is, that there are member accounts which look like that:
membername/con
[snip]
> if($string = 'test/contact.html')
That's
if($string == 'test/contact.html')
of course... :)
[/snip]
it could be
if($string == "test/contact.html")
couldn't resist :)
Jay
P.S. John, nothing on that thing yet.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
John W. Holmes wrote:
Merlin wrote:
^\/test\/contact.html$
does not work. I am sorry, I just found that
it has to be:
test/contact.html
and not
dir/test/contact.html
there is no leading slash.
Do you have any other suggestion?
Are you making this too hard?
if($string = 'test/contact.html')
Merlin wrote:
^\/test\/contact.html$
does not work. I am sorry, I just found that
it has to be:
test/contact.html
and not
dir/test/contact.html
there is no leading slash.
Do you have any other suggestion?
*sigh*
^test\/contact.html$
Kae
--
PHP General Mailing List (http://www.php.net/)
To u
Merlin wrote:
^\/test\/contact.html$
does not work. I am sorry, I just found that
it has to be:
test/contact.html
and not
dir/test/contact.html
there is no leading slash.
Do you have any other suggestion?
Are you making this too hard?
if($string = 'test/contact.html')
{ echo 'good'; } else {
> ^\/test\/contact.html$
does not work. I am sorry, I just found that
it has to be:
test/contact.html
and not
dir/test/contact.html
there is no leading slash.
Do you have any other suggestion?
--
Merlin wrote:
Hi there,
I have a regex problem.
Basicly I do not want to match:
/dir/test/contact.html
But I do want to match:
/test/contact.html
I tryed this one:
^[!dir]/(.*)/contact(.*).html$
but it does not work and I tryed thousands of other ways plus read
tutorials.
Can anybody please hel
hi john,
try a regex like this:
'/]*>(.*)/i'
ciao SVEN
John Herren wrote:
> Can't seem to get this to work...
>
> trying to yank stuff xxx from
> xxx
>
> and stuff yyy from
>
> yyy
>
> preg_match("| (.*)$|i", $l, $regs);
>
> works for the second example, even though it isn't the correct way,
> bu
First, the prob you got : WARNING
comes from the following error:
(\s+face=\"Verdana, Arial, Helvetica, sans-serif\"|)>
After the | (OR) sign, you must define another case, example:
echo eregi_replace ("(\s*)\s*\s*purchasing power parity", '%POWER%',
'sdsdssPurchasing power parity');
Secondl
Tim Steele wrote:
> i need to uses reg ex to change to target=_blank>
>
> the < brackets have to be represented using < and >
>
> I have tried so many ways, but none work. here is an example of my
> faliure.
>
> $body =
> preg_replace("/(href=\/?)(\w+)(>\/?)/e","'\\1'.'\\2'./'target=_blank/
> '.'
sven wrote:
looks like id3v2 ;-)
how about this:
$string = "<[TIT2]> ABC <[TPE1]> GHI <[TALB]> XYZ";
$pattern = "/<\[TIT2\]>([^<]*)/"; // matches anything exept '<'; till '<' or
end of string
preg_match($pattern, $string, $match);
var_export($match);
Yeah, Im trying to figure out a way to parse t
looks like id3v2 ;-)
how about this:
$string = "<[TIT2]> ABC <[TPE1]> GHI <[TALB]> XYZ";
$pattern = "/<\[TIT2\]>([^<]*)/"; // matches anything exept '<'; till '<' or
end of string
preg_match($pattern, $string, $match);
var_export($match);
hint to your regex:
either use quantifier '*' (0-n times)
True, but since the code is being run by 3rd parties, I don't have a
guarantee that
the browsecap.ini file is available on the server.
Monty wrote:
Maybe it might be easier to just use the get_browser() function:
http://www.php.net/manual/en/function.get-browser.php
Monty
--
PHP General Mai
Maybe it might be easier to just use the get_browser() function:
http://www.php.net/manual/en/function.get-browser.php
Monty
> From: [EMAIL PROTECTED] (Gerard Samuel)
> Newsgroups: php.general
> Date: Thu, 05 Jun 2003 14:00:23 -0400
> To: [EMAIL PROTECTED]
> Subject: Regex for Browser Versions
>
> -Original Message-
> From: Monty [mailto:[EMAIL PROTECTED]
> Sent: 31 May 2003 21:21
>
> If you want the entire string to be tested for digits, you
> need to add the
> length of the string to the regex pattern:
>
> $length = strlen($data);
> preg_match("[0-9]{$length}", $data);
I had no idea their was a is_numeric function(). Ill check it out. Its
probably a lot better to use then trying to preg_match()/
Many thanks
- Original Message -
From: "Monty" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 31, 2003 3:21 PM
Su
I don't understand what it is you're trying to accomplish, so, it's hard to
offer a solution. If you just want to verify whether or not a variable
contains numeric data, why not just use the is_numeric() function:
http://us4.php.net/manual/en/function.is-numeric.php
preg_match() will return T
Anyone? please?
Thanks!
Shawn
"Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm using the following to try and replace urls in my html output:
>
> $newhrefs = preg_replace("/script.php\?(.*)=(.*)&(.*)=(.*)&(.*)=(.*)/",
> "script-$1-$2-$3-$4-$5-$6.html", $hrefs);
On Fri, Feb 07, 2003 at 05:29:49PM +0100, Marian Feiler wrote:
>
> i have to check if there's a dot in a string, and i need nothing but the
> regex pattern for this... tryed a lot, but the dot itself means to matches
> all.
You can escape the dot either by putting a backslash in front of it or
pu
On Thu, Dec 12, 2002 at 11:01:47PM -0800, Troy May wrote:
>
> How would take a regular non-formatted text link (http://www.link.com) and
> turn it into ready to post HTML? (href=http://www.link.com>http://www.link.com)
>
> Darn, Outlook formats it, but you get the idea. It would just be typed out
In article <[EMAIL PROTECTED]>, eurleif@buyer-
brokerage.com says...
> I'm looking for a regex which splits a string by commas, but only if the
> comma is not in parenthesis. I know I'm being lazy and should write it
> myself, but that's just it... I'm lazy!
Well, as it happens I'm too lazy t
1 - 100 of 120 matches
Mail list logo