[PHP] Re: Regex

2012-07-27 Thread Al
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,

Re: [PHP] Re: Regex

2012-07-27 Thread David Harkness
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

Re: [PHP] Re: Regex

2012-07-27 Thread Al
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

Re: [PHP] Re: Regex for extracting quoted strings

2011-03-07 Thread Shawn McKenzie
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

[PHP] Re: Regex for extracting quoted strings

2011-03-05 Thread Nathan Rixham
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

[PHP] Re: Regex for extracting quoted strings

2011-03-05 Thread Shawn McKenzie
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

Re: [PHP] Re: Regex for extracting quoted strings

2011-03-05 Thread Simon J Welsh
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

Re: [PHP] Re: Regex for extracting quoted strings

2011-03-05 Thread Mark Kelly
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

Re: [PHP] Re: Regex for extracting quoted strings

2011-03-05 Thread Shuo
Maybe this will help. $regex = '/(?=)[^.]*(?=)/'; $r = preg_match_all($regex, $sentence, $phrases);

[PHP] Re: Regex for ... genealogical names

2011-01-01 Thread Al
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

[PHP] Re: Regex for telephone numbers

2010-12-31 Thread Al
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

Re: [PHP] Re: Regex for telephone numbers

2010-12-31 Thread a...@ashleysheridan.co.uk
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

Re: [PHP] Re: Regex for telephone numbers

2010-12-31 Thread Al
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

Re: [PHP] Re: Regex for telephone numbers

2010-12-31 Thread Per Jessen
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

[PHP] Re: Regex Problem

2009-07-31 Thread Igor Escobar
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

[PHP] Re: Regex Problem

2009-07-31 Thread Shawn McKenzie
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

Re: [PHP] Re: Regex Problem

2009-07-31 Thread Shawn McKenzie
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 +

Re: [PHP] Re: Regex Problem

2009-07-31 Thread Shawn McKenzie
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 +

[PHP] Re: Regex help

2008-09-09 Thread Nathan Rixham
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:

Re: [PHP] Re: Regex help

2008-09-09 Thread Jason Pruim
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

Re: [PHP] Re: Regex help

2008-09-09 Thread Nathan Rixham
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

Re: [PHP] Re: Regex help

2008-09-09 Thread Per Jessen
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

Re: [PHP] Re: Regex help

2008-09-09 Thread Jason Pruim
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

Re: [PHP] Re: Regex help

2008-09-09 Thread Jochem Maas
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

Re: [PHP] Re: Regex help

2008-09-09 Thread Jason Pruim
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

Re: [PHP] Re: Regex help

2008-09-09 Thread Jochem Maas
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

[PHP] Re: regex

2008-08-13 Thread Philip Thompson
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

Re: [PHP] Re: regex

2008-08-13 Thread Micah Gersten
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,

[PHP] Re: regex

2008-08-13 Thread Shawn McKenzie
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=([^]+)+/';

RE: [PHP] Re: regex

2008-08-13 Thread Boyd, Todd M.
-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

Re: [PHP] Re: regex

2008-08-13 Thread Philip Thompson
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 =

Re: [PHP] Re: regex

2008-08-13 Thread Philip Thompson
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

[PHP] Re: Regex in PHP

2008-06-04 Thread Al
$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

[PHP] Re: Regex in PHP

2008-06-04 Thread Shawn McKenzie
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

[PHP] Re: Regex for Advanced search feature

2007-10-19 Thread Al
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,

[PHP] Re: Regex error

2007-03-14 Thread Al
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,

[PHP] re regex error

2007-03-14 Thread jekillen
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

Re: [PHP] re regex error

2007-03-14 Thread Jim Lucas
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

[PHP] Re: Regex

2006-08-23 Thread Nadim Attari
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

[PHP] Re: Regex

2006-08-21 Thread Ivo F.A.C. Fokkema
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.

[PHP] Re: Regex

2006-08-21 Thread M. Sokolewicz
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

Re: [PHP] Re: Regex

2006-08-21 Thread Dave Goodchild
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

[PHP] Re: Regex

2006-08-21 Thread Alex Turner
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);

Re: [PHP] Re: Regex

2006-08-21 Thread J R
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

[PHP] Re: RegEx drop everything after last pattern

2005-12-23 Thread Al
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

[PHP] Re: Regex for balanced brackets?

2005-11-22 Thread Al
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

[PHP] Re: regex and global vars problem

2005-10-27 Thread Al
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(

[PHP] Re: RegEx - Is this right?

2005-10-16 Thread Oliver Grätz
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/)

[PHP] Re: REGEX Help Please

2005-09-19 Thread Mark Rees
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

[PHP] Re: Regex help

2005-06-06 Thread Al
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:

[PHP] RE: regex question

2005-05-17 Thread Carl Furst
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

[PHP] Re: Regex help

2005-01-28 Thread Stian Berger
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

[PHP] Re: Regex Parsing

2004-12-05 Thread M. Sokolewicz
[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

[PHP] Re: Regex Parsing

2004-12-05 Thread [ rswfire ]
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

[PHP] Re: Regex Parsing

2004-12-05 Thread M. Sokolewicz
[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] Re: regex help and file question

2004-08-07 Thread Torsten Roehr
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

Re: [PHP] Re: regex help and file question

2004-08-07 Thread PHP Gen
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

Re: [PHP] Re: regex help needed -- Solved! Thanks!

2004-08-02 Thread Fabrice Lezoray
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

[PHP] Re: regex help needed

2004-08-01 Thread M. Sokolewicz
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

[PHP] Re: regex help needed

2004-08-01 Thread Fabrice Lezoray
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 :

RE: [PHP] Re: regex help needed -- Solved! Thanks!

2004-08-01 Thread Kathleen Ballard
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

[PHP] Re: regex problem

2004-07-01 Thread Lars Torben Wilson
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,

[PHP] Re: regex problem

2004-07-01 Thread Josh Close
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;

Re: [PHP] Re: Regex Help

2004-01-27 Thread karthikeyan.balasubramanian
: 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

Re: [PHP] Re: Regex Help

2004-01-27 Thread Ben Ramsey
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

[PHP] Re: Regex Help

2004-01-26 Thread Ben Ramsey
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

[PHP] Re: Regex help please

2004-01-11 Thread Manuel Vázquez Acosta
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

[PHP] Re: Regex to grab a Windows Path from a String...

2003-12-17 Thread Sven
[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

[PHP] Re: RegEx -- help

2003-10-10 Thread Curt Zirzow
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,

Re: [PHP] Re: RegEx -- help

2003-10-10 Thread Robert Cummings
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

[PHP] Re: regex/preg_replace() difficulty

2003-10-01 Thread Jon Kriek
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

[PHP] Re: regex problem

2003-08-15 Thread Kae Verens
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

[PHP] Re: regex problem

2003-08-15 Thread Merlin
^\/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

Re: [PHP] Re: regex problem

2003-08-15 Thread John W. Holmes
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 {

[PHP] Re: regex problem

2003-08-15 Thread Kae Verens
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

Re: [PHP] Re: regex problem

2003-08-15 Thread John W. Holmes
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')

RE: [PHP] Re: regex problem

2003-08-15 Thread Jay Blanchard
[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:

[PHP] Re: regex problem

2003-08-15 Thread Merlin
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:

Re: [PHP] Re: regex problem

2003-08-15 Thread Kae Verens
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

[PHP] Re: regex problem

2003-08-15 Thread Kae Verens
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:

Re: [PHP] Re: regex problem

2003-08-15 Thread Marek Kilimajer
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

Re: [PHP] Re: regex problem

2003-08-15 Thread Merlin
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.

[PHP] Re: regex problem

2003-08-15 Thread Merlin
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

Re: [PHP] Re: regex problem

2003-08-15 Thread Curt Zirzow
* 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

Re: [PHP] Re: regex problem

2003-08-15 Thread Curt Zirzow
* 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,

RE: [PHP] Re: regex problem

2003-08-15 Thread Wouter van Vliet
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

[PHP] Re: regex help?

2003-07-21 Thread sven
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

[PHP] Re: Regex help needed

2003-07-16 Thread Nomadeous
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,

[PHP] Re: Regex nightmare:(

2003-07-10 Thread sven
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 =

[PHP] Re: Regex Help with - ?

2003-06-27 Thread sven
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

Re: [PHP] Re: Regex Help with - ?

2003-06-27 Thread Gerard Samuel
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. --

[PHP] Re: Regex for Browser Versions

2003-06-06 Thread Monty
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

Re: [PHP] Re: Regex for Browser Versions

2003-06-06 Thread Gerard Samuel
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

RE: [PHP] Re: regex problem

2003-06-03 Thread Ford, Mike [LSS]
-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

[PHP] Re: regex problem

2003-06-01 Thread Monty
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

[PHP] Re: regex question?

2003-02-24 Thread Shawn McKenzie
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

[PHP] Re: regex

2003-02-07 Thread Paul Chvostek
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

[PHP] Re: Regex question

2002-12-12 Thread Paul Chvostek
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

[PHP] Re: Regex for split() to split by , which is not in ()s?

2002-09-17 Thread David Robley
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] Re: regex help

2002-09-05 Thread Richard Lynch
?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   2   >