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,
On Fri, Jul 27, 2012 at 11:43 AM, Al n...@ridersite.org 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 2:56 PM, David Harkness wrote:
On Fri, Jul 27, 2012 at 11:43 AM, Al n...@ridersite.org 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
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
without
the
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 contain
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 she
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
$sentence = 'Dave said
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
Maybe this will help.
$regex = '/(?=)[^.]*(?=)/';
$r = preg_match_all($regex, $sentence, $phrases);
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
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
Erm, you say regex is overkill, then use one in your example!
Thanks,
Ash
http://www.ashleysheridan.co.uk
- Reply message -
From: Al n...@ridersite.org
Date: Fri, Dec 31, 2010 15:53
Subject: [PHP] Re: Regex for telephone numbers
To: php...@lists.php.net, php-general@lists.php.net
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: Aln...@ridersite.org
Date: Fri, Dec 31, 2010 15:53
Subject: [PHP] Re: Regex for telephone numbers
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
MySQL 5.1 PHP 5 Linux
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
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)
On
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
+
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
+
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 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
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
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
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
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
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
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
Figured it out. Just needed to stretch my brain a lil.
On Aug 13, 2008, at 3:07 PM, Philip Thompson wrote:
?php
function blegh ($subject) {
// I know this pattern doesn't exactly work
$pattern = '/(.*).php\?action=([^].*)/';
$pattern = '/(.*).php\?action=([^]+)+/';
preg_match
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,
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:
?php
function blegh ($subject) {
// I know this pattern doesn't exactly work
$pattern = '/(.*).php\?action=([^].*)/';
$pattern = '/(.*).php\?action=([^]+)+/';
-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.
On Aug 13, 2008, at 3:07 PM, Philip
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:
?php
function blegh ($subject) {
// I know this pattern doesn't exactly work
$pattern =
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
$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
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
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,
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(member value='[a-zA-Z ]{1,25}' uspace='([a-z0-9-\.\/]{2,11})'
id='$m[1]', $groups,
Hello again;
Regarding the error I was inquiring about:
Warning: ereg() [function.ereg]: REG_ERANGE in path info_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
jekillen wrote:
Hello again;
Regarding the error I was inquiring about:
Warning: ereg() [function.ereg]: REG_ERANGE in path info_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
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. a href etc added
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 clickable, i.e.
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. a href etc added automatically.
Some
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
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);
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
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
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.
?php
/*
* ex. 00:AA:11:BB:22:CC
*/
function chk_mac( $mac ) {
if( ( eregi(
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
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:
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
?php
$string = @ one more T@@me for @ and i@ the Bl@@dy [EMAIL
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
[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
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
[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
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 file I
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() requires a
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('#h[1-9](.*)/h[1-9]#Uie',
'str_replace(br
/, , $1
You could try something like:
$return = preg_replace('#h[1-9](.*)/h[1-9]#Uie', 'str_replace(br
/, , $1)');
- Tul
Kathleen Ballard wrote:
Sorry,
Here is the code I am using to match the h* tags:
h([1-9]){1}.*/h([1-9]){1}
I have removed all the NL and CR chars from the string
I am matching to make
hi
M. Sokolewicz a écrit :
You could try something like:
$return = preg_replace('#h[1-9](.*)/h[1-9]#Uie', 'str_replace(br
/, , $1)');
- Tul
Kathleen Ballard wrote:
Sorry,
Here is the code I am using to match the h* tags:
h([1-9]){1}.*/h([1-9]){1}
I think this mask is better :
and the '#'?
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 something like
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,
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\nworld\n;
: 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 starting
point for you to work with. Try out this code and then play
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
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
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 this
[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
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,
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 this:
I'm
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
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
^\/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?
--
lt;IFRAME
SRC=http://saratoga.globosapiens/associates/report_member.php?u=3color=EEE
EEE
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 {
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
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')
[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:
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:
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
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:
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
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 explain that better.
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 better. I
* 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 since
* 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 string?
heh,
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]
Onderwerp: [PHP] Re
hi john,
try a regex like this:
'/td[^]*(.*)/td/i'
ciao SVEN
John Herren wrote:
Can't seem to get this to work...
trying to yank stuff xxx from
TD class=a8b noWrap align=middle width=17 bgColor=#ccxxx/TD
and stuff yyy from
TD class=a8b noWrap width=100nbsp;yyy/TD
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 (tr bgcolor=\#F8F8F1\(\s*)td\s*font
size=\2\(\s+face=\Verdana, Arial, Helvetica,
Tim Steele wrote:
i need to uses reg ex to change a href=url to a href=url
target=_blank
the brackets have to be represented using lt; and gt;
I have tried so many ways, but none work. here is an example of my
faliure.
$body =
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) OR '?' (0-1
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 these tags.
--
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
Im
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
-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);
Or anchor
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
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);
This works
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
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? (a
href=http://www.link.comhttp://www.link.com/a)
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 to
?php
$str = 'hi bmy friend/b! br / this message uses html entities a
href=http://www.trini0.org;test/a!';
$str = preg_replace('/(a href=http:\/\/.*.*\/a)/',
htmlspecialchars($1), $str);
Maybe I'm missing something here, but can't you just do:
$str = htmlspecialchars($str);
--
Like Music?
1 - 100 of 120 matches
Mail list logo