Re: [PHP] Regular Expression help

2006-01-19 Thread John Nichel
Chris wrote: snip preg_replace('/(?!^)([A-Z])/','_$1','JimJoeBobBriggs'); Ohhhregex-fu black belt. ;) -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] regular expression for integer range

2005-09-08 Thread Mark Rees
Murray @ PlanetThoughtful [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, I want to write regular expression for checking the string format entered by user. the allowed formats are examples: 10 10, 10,12-10 12-10 that is the valid strings are: 1.

Re: [PHP] regular expression for integer range

2005-09-07 Thread Robin Vickery
On 9/6/05, babu [EMAIL PROTECTED] wrote: Hi all, I want to write regular expression for checking the string format entered by user. the allowed formats are examples: 10 10, 10,12-10 12-10 that is the valid strings are: 1. only integer 2. an integer, range of integers example

RE: [PHP] regular expression for integer range

2005-09-07 Thread Murray @ PlanetThoughtful
Hi all, I want to write regular expression for checking the string format entered by user. the allowed formats are examples: 10 10, 10,12-10 12-10 that is the valid strings are: 1. only integer 2. an integer, range of integers example 3 and no other characters must be

Re: [PHP] regular expression for integer range

2005-09-06 Thread Philip Hallstrom
On Tue, 6 Sep 2005, babu wrote: Hi all, I want to write regular expression for checking the string format entered by user. the allowed formats are examples: 10 10, 10,12-10 12-10 that is the valid strings are: 1. only integer 2. an integer, range of integers example 3 and no other

Re: [PHP] regular expression for integer range

2005-09-06 Thread John Nichel
babu wrote: Hi all, I want to write regular expression for checking the string format entered by user. the allowed formats are examples: 10 10, 10,12-10 12-10 that is the valid strings are: 1. only integer 2. an integer, range of integers example 3 and no other characters must be

Re: [PHP] regular expression for time

2005-08-29 Thread Leif Gregory
Hello babu, Monday, August 29, 2005, 6:50:32 AM, you wrote: how can i write regular expression for time in 24-hour format i:e, HH:MM:SS. using preg_match. ?php $xtime=19:59:53; if (preg_match(/([01][0-9]|[2][0-3]):[0-5][0-9]:[0-5][0-9]/, $xtime)) echo Good; else echo Bad; ? --

Re: [PHP] Regular expression question

2005-08-12 Thread Robin Vickery
On 8/11/05, Leon Vismer [EMAIL PROTECTED] wrote: Hi Robin Many thanks for this, how would one extend this to support the following: $str = insert into userComment (userID, userName, userSurname) values (0, 'Leon', 'mcDonald'); one does not want $str = insert into user_comment

Re: [PHP] Regular expression question

2005-08-11 Thread b-bonini
n Thu, 11 Aug 2005, Leon Vismer wrote: Hi I would like to convert from one naming convention within a sql statement to another. I have the following, code $str = insert into userComment (userID, userName, userSurname) values (0, 'Leon', 'Vismer'); $match = array( /([a-z]+)(ID)/,

Re: [PHP] Regular expression question

2005-08-11 Thread Leon Vismer
Hi Just a quick note; why dont' you search on user since it's the constant and replace 'user[A-Z]' with 'user_[a-z]' or in the case of userID 'user[A-Z]{2}' This is part of my problem user will not always be constant, I basically want to be able to change between two naming conventions.

Re: [PHP] Regular expression question

2005-08-11 Thread Robin Vickery
On 8/11/05, Leon Vismer [EMAIL PROTECTED] wrote: Hi I would like to convert from one naming convention within a sql statement to another. I have the following, code $str = insert into userComment (userID, userName, userSurname) values (0, 'Leon', 'Vismer'); $match = array(

Re: [PHP] Regular expression question

2005-08-11 Thread Leon Vismer
Hi Robin Many thanks for this, how would one extend this to support the following: $str = insert into userComment (userID, userName, userSurname) values (0, 'Leon', 'mcDonald'); one does not want $str = insert into user_comment (user_id, user_name, user_surname) values (0, 'Leon',

Re: [PHP] Regular expression help

2005-08-02 Thread John Nichel
David Christensen wrote: I just plain suck at regex, so I was hoping to get some hints from you regex experts out there. I'm sure it's been done a thousand times, but I can't seem to find what I'm looking for with a simple google search: $phone could be 1234567890 OR $phone could be

Re: [PHP] Regular Expression to replace pseudo-HTML?

2005-04-21 Thread Philip Hallstrom
I'm hoping someone can help me figure out a regex that will replace pseudo-HTML codes in a string with desired HTML equivalents. In particular, I'm trying to implement a message quoting facility, such as when you click on the 'quote' button in phpBB.

Re: [PHP] Regular expression. What is wrong?

2005-02-14 Thread Richard Lynch
Kostyantyn Shakhov wrote: I have to check the phone number. I use some regular expression for this. The phone number can contain only numbers and characters like +,-,),( and space. The problem is when I use a Perl-style all works as intended but when I use a Posix-style I've got the Warning:

Re: [PHP] regular expression help

2005-01-21 Thread Jason Wong
On Saturday 22 January 2005 00:12, Jason wrote: Simple functions to check fix if necessary invalid formating of a MAC address... I seem to be having problems with the global variable $mac not being returned from the fix_mac() function. Any help is appreciated. Your subject says regular

Re: [PHP] regular expression help

2005-01-21 Thread Bret Hughes
On Fri, 2005-01-21 at 10:12, Jason wrote: Simple functions to check fix if necessary invalid formating of a MAC address... I seem to be having problems with the global variable $mac not being returned from the fix_mac() function. Any help is appreciated. ?php /* * ex.

Re: [PHP] regular expression help

2005-01-21 Thread Richard Lynch
Jason wrote: Simple functions to check fix if necessary invalid formating of a MAC address... I seem to be having problems with the global variable $mac not being returned from the fix_mac() function. Any help is appreciated. function fix_mac( $mac ) { global $mac; It's really weird to

Re: [PHP] regular expression help

2005-01-21 Thread Jochem Maas
Richard Lynch wrote: Jason wrote: Simple functions to check fix if necessary invalid formating of a MAC address... I seem to be having problems with the global variable $mac not being returned from the fix_mac() function. Any help is appreciated. function fix_mac( $mac ) { global $mac; It's

Re: [PHP] Regular Expression for a UK Mobile

2004-10-15 Thread Gareth Williams
Do you even need a regex? What about if (strlen($_POST['mobile_number']) != 11 substr($_POST['mobile_number'],0,3) != 447) { $error=Invalid Number; } On 15 Oct 2004, at 13:38, Shaun wrote: Hi, Could anyone help me with a reugular expression for a UK mobile phone number? So far I have tried

Re: [PHP] Regular Expression for a UK Mobile

2004-10-15 Thread Robert Cummings
On Fri, 2004-10-15 at 07:45, Gareth Williams wrote: Do you even need a regex? What about if (strlen($_POST['mobile_number']) != 11 substr($_POST['mobile_number'],0,3) != 447) { $error=Invalid Number; } This doesn't verify that the portion following 447 is also a number.

Re: [PHP] Regular Expression for a UK Mobile

2004-10-15 Thread Jason Wong
On Friday 15 October 2004 19:38, Shaun wrote: Could anyone help me with a reugular expression for a UK mobile phone number? So far I have tried this but with no success snip $regexp = /^447[0-9]{9}$/; if(!preg_match( $regexp, $_POST[mobile_number] )){ $error = Invalid Mobile Number;

Re: [PHP] Regular Expression for a UK Mobile

2004-10-15 Thread John Nichel
Shaun wrote: Hi, Could anyone help me with a reugular expression for a UK mobile phone number? So far I have tried this but with no success snip $regexp = /^447[0-9]{9}$/; if(!preg_match( $regexp, $_POST[mobile_number] )){ $error = Invalid Mobile Number; /snip The number nust be 11 numbers

RE: [PHP] Regular Expression for a UK Mobile

2004-10-15 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 15 October 2004 12:39, Shaun wrote: Hi, Could anyone help me with a reugular expression for a UK mobile phone number? So far I have tried this but with no success

Re: [PHP] Regular Expression for a UK Mobile

2004-10-15 Thread Chris Dowell
Try is_int($_POST['mobile_number']) or ctype_digit($_POST['mobile_number']) HTH Cheers Chris Robert Cummings wrote: On Fri, 2004-10-15 at 07:45, Gareth Williams wrote: Do you even need a regex? What about if (strlen($_POST['mobile_number']) != 11 substr($_POST['mobile_number'],0,3) != 447) {

Re: [PHP] Regular Expression for a UK Mobile

2004-10-15 Thread Gareth Williams
You could add is_integer() into the if statement. On 15 Oct 2004, at 14:07, Robert Cummings wrote: On Fri, 2004-10-15 at 07:45, Gareth Williams wrote: Do you even need a regex? What about if (strlen($_POST['mobile_number']) != 11 substr($_POST['mobile_number'],0,3) != 447) {

Re: [PHP] Regular Expression - highlighting

2004-10-07 Thread Aidan Lister
Hi Michael, Thanks very much for the assistance, I'll have to investigate further! Kind Regards, Aidan Lister Michael Sims [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Aidan Lister wrote: Hello list, I'm pretty terrible with regular expressions, I was wondering if someone

Re: [PHP] Regular expression

2004-10-07 Thread Hans H. Anderson
Alawi, You should get some sort of nothing to repeat error. Try moving the * to a + and putting it after the [0-9]. I'm not sure that the * is picking up anything, because it's not preceded by anything. It could be that your $html doesn't match quite right, too (tabs and newlines differ from

Re: [PHP] Regular expression

2004-10-07 Thread Greg Donald
On Thu, 7 Oct 2004 12:12:10 -0500 (CDT), Hans H. Anderson [EMAIL PROTECTED] wrote: It could be that your $html doesn't match quite right, too (tabs and newlines differ from $html to the regular expression). So I tried this with success: The 's' modifier will assist with matching across

RE: [PHP] Regular Expression - highlighting

2004-10-03 Thread Michael Sims
Aidan Lister wrote: Hello list, I'm pretty terrible with regular expressions, I was wondering if someone would be able to help me with this http://paste.phpfi.com/31964 The problem is detailed in the above link. Basically I need to match the contents of any HTML tag, except a link. I'm

Re: [PHP] regular expression help

2004-09-29 Thread Petar Nedyalkov
On Wednesday 29 September 2004 08:46, Ed Lazor wrote: complain Today I discovered that my ISP can't upgrade to PHP 5. They use Plesk for server Administration and PHP 5 apparently breaks Plesk. Plesk says they'll make PHP 5 support available as soon as it starts coming default on RedHat

RE: [PHP] regular expression help

2004-09-29 Thread Ed Lazor
Thanks to everyone who sent in patterns =) They worked like a charm =) $pattern = /\{\$(.+?)\}/i; $replacement = \\.\$$1\.\; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] regular expression help

2004-09-28 Thread Matthew Fonda
Howdy, Regular expressions are a simple way of matching patters. You can learn more about regular expressions in general here: http://www.opengroup.org/onlinepubs/007908799/xbd/re.html If you are interested in using regular expressions in PHP, check out these sites:

Re: [PHP] Regular Expression: Markup Code

2004-09-13 Thread Tom Rogers
Hi, Tuesday, September 14, 2004, 6:04:44 AM, you wrote: r Hello, would someone please help me with my regular expressions? They are so r complex! r Here is what I need to do. I have a string with contents similar to the r following: r BLOCK NAME=TOP r(a bunch of markup code)

Re: [PHP] Regular expression help

2004-09-09 Thread John Holmes
From: Skippy [EMAIL PROTECTED] I'm trying to replace all occurances of the X character in a text with Y, but only those X's that occur between bold tags (b/b). ?php $str = 'This X and this X will not be fixed, but bthis X and/b and hopefully this bX/b should be, along b with this X also. /b, but

Re: [PHP] Regular expression help

2004-09-09 Thread Skippy
Quoting John Holmes [EMAIL PROTECTED]: From: Skippy [EMAIL PROTECTED] I'm trying to replace all occurances of the X character in a text with Y, but only those X's that occur between bold tags (b/b). ?php $str = 'This X and this X will not be fixed, but bthis X and/b and hopefully this

Re: [PHP] Regular expression help

2004-08-25 Thread John Holmes
Daniel Lahey wrote: I'm trying to figure out how to formulate a regular expression that will get me everything following a pound sign (#) up to the first space or { character. (I'm trying to parse the ids out of a style sheet.) Can anyone point me in the right direction? I've been searching

Re: [PHP] Regular expression help

2004-08-25 Thread Ramil Sagum
On Tue, 24 Aug 2004 23:53:53 -0700, Daniel Lahey [EMAIL PROTECTED] wrote: I'm trying to figure out how to formulate a regular expression that will get me everything following a pound sign (#) up to the first space or { character. (I'm trying to parse the ids out of a style sheet.) Can anyone

Re: [PHP] regular expression

2004-07-02 Thread Josh Close
First of all, you might want to put more than one % probably like %%% Reason is, asp users % % like php uses ? ?. Just a precaution. You almost had the regex right. /%[a-z]+%/i Thans means, starts with a %, can match a-z, at least once (the + part) but as many times (greedy), then another

Re: [PHP] Regular Expression Help

2004-06-30 Thread Curt Zirzow
* Thus wrote Pablo Gosse: Here's the working regular expresssion: /^[a-zA-Z0-9\(\)]{1}[ a-zA-Z0-9\(\)_\,\.\-\'\]{1,999}$/ for starters, that doesn't give me a warning at all. also, all those escapes arn't needed: $reg = '/^[a-zA-Z0-9()]{1}[ a-zA-Z0-9()_,.\'-]{1,999}$/'; The ' is only

Re: Re: [PHP] Regular Expression - it works but uses way too much memory ?

2004-06-19 Thread Ulrik S. Kofod
Robin Vickery sagde: The S modifier that you're using means that it's storing the studied expression. If the regexp changes each time around the loop then over 3 iterations, that'll add up. See if removing that modifier helps at all. The S modifier wasn't needed, I added it because I

Re: [PHP] Regular Expression - it works but uses way too much memory ?

2004-06-18 Thread Ulrik S. Kofod
Sorry to post this again but it's a little urgent. The preg_replace in my script allocates a little memory every time it is called and doesn't free it again untill the script ends. I don't know if it is normal behaviour for preg_replace or if it is my reg. exp. that causes this. The problem is

Re: Re: [PHP] Regular Expression - it works but uses way too much memory ?

2004-06-18 Thread Robin Vickery
On Fri, 18 Jun 2004 08:57:19 +0200 (CEST), Ulrik S. Kofod [EMAIL PROTECTED] wrote: Sorry to post this again but it's a little urgent. The preg_replace in my script allocates a little memory every time it is called and doesn't free it again untill the script ends. I don't know if it is

Re: [PHP] Regular expression question

2004-05-27 Thread Rob Ellis
On Thu, May 27, 2004 at 09:59:05AM -0700, Dan Phiffer wrote: So I'm trying to implement a simple wiki-like syntax for hyperlinking. Basically I want to match stuff like [this], where the word 'this' gets turned into a hyperlink. I have that working, but I want to be able to escape the

Re: [PHP] Regular expression question

2004-05-27 Thread Justin Patrin
Rob Ellis wrote: On Thu, May 27, 2004 at 09:59:05AM -0700, Dan Phiffer wrote: So I'm trying to implement a simple wiki-like syntax for hyperlinking. Basically I want to match stuff like [this], where the word 'this' gets turned into a hyperlink. I have that working, but I want to be able to

RE: [PHP] Regular Expression

2004-05-18 Thread Chris W. Parker
Chris Boget mailto:[EMAIL PROTECTED] on Tuesday, May 18, 2004 9:55 AM said: Why isn't my regex working? From everything that I've read, it should be... $string = [joebob]; if( preg_match( '/\[(\s+)\]/i', $string, $aMatches )) { \s Matches any whitespace character; this is equivalent

Re: [PHP] Regular Expression

2004-05-18 Thread Ryan Carmelo Briones
Chris Boget wrote: Why isn't my regex working? From everything that I've read, it should be... script language=php $string = [joebob]; if( preg_match( '/\[(\s+)\]/i', $string, $aMatches )) { print_r( $aMatches ); } else { echo 'No match was found' . \n\n; } /script Chris your regex is

RE: [PHP] Regular Expression

2004-05-05 Thread Martin, Stanley G [Contractor for Sprint]
Here's a neat little tool I came across while taking an ASP.NET course at a local college for creating regular expressions. I've used it with my Perl/PHP scripting also. Regular Expression Designer http://www.radsoftware.com.au/web/Default.aspx Stanley G. Martin System Administrator Sprint -

Re: [PHP] Regular Expression for a UK mobile phone number

2004-04-08 Thread Michal Migurski
I am trying to create a regular expression for a mobile phone number. The number must be 12 digits long(0-9) and begin with 447 and have no spaces. So far I have come up with this but it keeps telling me the number is invalid even when its correct! Try this: $regexp = /447[0-9]{9}/;

Re: [PHP] Regular Expression for a UK mobile phone number

2004-04-08 Thread Shaun
Michal Migurski [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am trying to create a regular expression for a mobile phone number. The number must be 12 digits long(0-9) and begin with 447 and have no spaces. So far I have come up with this but it keeps telling me the number is

Re: [PHP] Regular Expression for a UK mobile phone number

2004-04-08 Thread Jochem Maas
you should also be considering spaces, leading zeros, brackets, dashes international notation. /^(((\+|00)[- ]?[0-9]{2,3}[- ]?(\(0\))?[- ]?[1-9]{1}[0-9]{1,})|(0[1-9]{1}[0-9]{1,}))[- ]?(([0-9]{7,})|([0-9]{3}[ -]{1}[0-9]{4}))$/ line-wrapping is unintentional, no garantees as to how good it is.

Re: [PHP] Regular Expression for a UK mobile phone number

2004-04-08 Thread Shaun
Thanks for your reply, but the number cannot be out side the UK or contain spaces, leading zeros, brackets or dashes Jochem Maas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] you should also be considering spaces, leading zeros, brackets, dashes international notation.

Re: [PHP] Regular Expression for a UK mobile phone number

2004-04-08 Thread Michal Migurski
but the regular expression still seems to reject the number... Can you provide an example of numbers it rejects? My answer was based on the simple fact that you were testing for numbers that matched, and returning a rejection based on that. The regexp is simple enough -- some examples of input

Re: [PHP] Regular Expression Help

2004-04-08 Thread Michal Migurski
I want to extract from a large number of html files everything between the following specified comments, including the comments themselves: !--Begin CMS Content--...!-- End CMS Content-- snip And the regular expression I've got is '/[!--Begin CMS Content\-\-].+[!-- End CMS Content\-\-]/s' I

Re: [PHP] Regular Expression for a UK mobile phone number

2004-04-08 Thread gohaku
On Apr 8, 2004, at 2:40 PM, Shaun wrote: Thanks for your reply Michal, but the regular expression still seems to reject the number... Just out of curiosity, Have you tried if(stripslashes(htmlentities($_POST[mobile_number]) ) != ) ? -- PHP General Mailing List (http://www.php.net/) To

RE: [PHP] regular expression

2004-04-07 Thread Simon Hayward
preg_match(/To: ([^]+)?([^]+)??/i,$string,$matches); returns email in $matches[1] in the first instance and name in $matches[1] and email in $matches[2] in the second. -Original Message- From: Robert Kornfeld [mailto:[EMAIL PROTECTED] Sent: 07 April 2004 09:32 To: [EMAIL PROTECTED]

Re: [PHP] regular expression

2004-04-07 Thread Red Wingate
Alright, first of all, in E-Mail Headers every param needs to be written in a seperate line, therefore following will work even with multiple recipients: $recipients = array(); $header = explode( \n , $header ); foreach ( $header AS $param ) { $param = trim ( $param ); if ( strtolower(

Re: [PHP] regular expression

2004-04-07 Thread Curt Zirzow
* Thus wrote Robert Kornfeld ([EMAIL PROTECTED]): hey, professionals out there: i need to write a parser for an email-header to retrieve the email of the 'To:'-field. there are 2 possibilities: 'To: [EMAIL PROTECTED]' or 'To: first foo [EMAIL PROTECTED]' Actually the second one needs to

[PHP] Re: PHP regular expression

2004-03-11 Thread Justin Patrin
Mike Mapsnac wrote: Hello I found this function online and want to understand how it works. I don't understand /^ and $/. I know that ^ beginning of the string but what is /^. Thanks function validEmail($email) { return

Re: [PHP] Re: PHP regular expression

2004-03-11 Thread Jason Davidson
I think he meant.. the carrot after the delimiter which means NOT.. like /[^a]/ means match anything thats not an 'a' Jason Justin Patrin [EMAIL PROTECTED] wrote: Mike Mapsnac wrote: Hello I found this function online and want to understand how it works. I don't understand /^ and

Re: [PHP] Re: PHP regular expression

2004-03-11 Thread Michal Migurski
preg_match(/^([a-zA-Z0-9])+([.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-]+)+[a-zA-Z0-9_-]$/,$email); The / characters are the regex delimiters. This is a throwback to the Perl language. Basically, the / show where the beginning and end of the regex is. You *MUST* have them. After the last

Re: [PHP] Regular expression help?

2004-02-02 Thread Adam Bregenzer
On Mon, 2004-02-02 at 14:15, Jas wrote: I have tried this but its not working. !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}\:[0-9a-fA-F]{2}$,$_POST['mac']) so it should match 2 characters 0-9a-fA-F each block of 2 characters

Re: [PHP] Regular expression help?

2004-02-02 Thread Jas
Adam Bregenzer wrote: On Mon, 2004-02-02 at 14:15, Jas wrote: I have tried this but its not working. !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}\:[0-9a-fA-F]{2}$,$_POST['mac']) so it should match 2 characters 0-9a-fA-F each block of 2 characters

Re: [PHP] Regular expression help?

2004-02-02 Thread Justin Patrin
Jas wrote: Adam Bregenzer wrote: On Mon, 2004-02-02 at 14:15, Jas wrote: I have tried this but its not working. !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}\:[0-9a-fA-F]{2}$,$_POST['mac']) so it should match 2 characters 0-9a-fA-F each

Re: [PHP] Regular Expression for Search/Replace

2004-01-16 Thread Brad Pauly
On Fri, 2004-01-16 at 09:49, Tobias Engelhardt wrote: Hi list, i hope someone can help me out... i have to replace a href=order.php?order_id=12345 with a href=order_12345.html any ideas? thank you! What about just using the variable to build the name? $file_name =

Re: [PHP] Regular Expression for Search/Replace

2004-01-16 Thread Tobias Engelhardt
That is not possible because the id's are hard-coded in thousands of html-pages. Not a very good idea, i know. It wasn't mine... I *have* to use search/replace. (A script processes each file in the directory) Brad Pauly wrote: What about just using the variable to build the name? $file_name =

Re: [PHP] Regular Expression for Search/Replace

2004-01-16 Thread Mike Migurski
i hope someone can help me out... i have to replace a href=order.php?order_id=12345 with a href=order_12345.html any ideas? thank you! PCRE style: '/a href=order.php\?order_id=(\d+)/' replaced by 'a href=order_$1.html'. -

Re: [PHP] Regular Expression for Search/Replace

2004-01-16 Thread Brad Pauly
On Fri, 2004-01-16 at 10:07, Tobias Engelhardt wrote: That is not possible because the id's are hard-coded in thousands of html-pages. Not a very good idea, i know. It wasn't mine... I *have* to use search/replace. (A script processes each file in the directory) Ah, I see. I think you could

Re: [PHP] Regular Expression for Search/Replace

2004-01-16 Thread Brad Pauly
On Fri, 2004-01-16 at 10:21, Brad Pauly wrote: On Fri, 2004-01-16 at 10:07, Tobias Engelhardt wrote: That is not possible because the id's are hard-coded in thousands of html-pages. Not a very good idea, i know. It wasn't mine... I *have* to use search/replace. (A script processes each

Re: [PHP] Regular Expression for Search/Replace

2004-01-16 Thread Tobias Engelhardt
Thanks, that solved the problem... Mike Migurski wrote: i hope someone can help me out... i have to replace a href=order.php?order_id=12345 with a href=order_12345.html any ideas? thank you! PCRE style: '/a href=order.php\?order_id=(\d+)/' replaced by 'a href=order_$1.html'.

Re: [PHP] Regular Expression

2003-12-29 Thread lingua2001
this, but they don work yet. So, please help me~~ Thank you in advance. Joshua - Original Message - Wrom: WIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJJ To: Joshua [EMAIL PROTECTED] Cc: PHP General list [EMAIL PROTECTED] Sent: Saturday, December 27, 2003 1:27 PM Subject: Re: [PHP] Regular Expression

Re: [PHP] Regular Expression

2003-12-27 Thread Kelly Hallman
On Sat, 27 Dec 2003, Joshua wrote: I'm trying to change the string, for example, $string = 11.abcd.32.efgh.53.ijk; to 11.abcd. 32.efgh. 53.ijk. with ereg_replace. Like ereg_replace(\.[0-9],BR,$string); How can I recover the original characters after replacing them with BR in

Re: [PHP] Regular Expression

2003-12-27 Thread Joshua
yet. So, please help me~~ Thank you in advance. Joshua - Original Message - From: Kelly Hallman [EMAIL PROTECTED] To: Joshua [EMAIL PROTECTED] Cc: PHP General list [EMAIL PROTECTED] Sent: Saturday, December 27, 2003 1:27 PM Subject: Re: [PHP] Regular Expression On Sat, 27 Dec 2003

Re: [PHP] Regular Expression Help Please

2003-12-01 Thread Rory McKinley
On 27 Nov 2003 at 11:48, Shaun wrote: Hi, I need to generate a lowercase alphanumeric passwrord thats 8 characters long, has anyone got a function that can do this? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] regular expression, image, name, alt, title, preg_match_all

2003-12-01 Thread Sophie Mattoug
Adam i Agnieszka Gasiorowski FNORD wrote: I'm trying to develop a regex for matching with preg_match_all, I want to match such things like image name, image alt text, image title in construct like this: html... div class=class style=style img src=img=name alt=alt title=title / span

Re: [PHP] regular expression, image, name, alt, title, preg_match_all

2003-12-01 Thread Sophie Mattoug
Sophie Mattoug wrote: Adam i Agnieszka Gasiorowski FNORD wrote: I'm trying to develop a regex for matching with preg_match_all, I want to match such things like image name, image alt text, image title in construct like this: html... div class=class style=style img src=img=name alt=alt

RE: [PHP] regular expression, image, name, alt, title, preg_match_all

2003-12-01 Thread Wouter van Vliet
Sophie Mattoug wrote: Adam i Agnieszka Gasiorowski FNORD wrote: I'm trying to develop a regex for matching with preg_match_all, I want to match such things like image name, image alt text, image title in construct like this: html... div class=class style=style img

Re: [PHP] regular expression, image, name, alt, title, preg_match_all

2003-12-01 Thread Adam i Agnieszka Gasiorowski FNORD
Sophie Mattoug wrote: Adam i Agnieszka Gasiorowski FNORD wrote: I'm trying to develop a regex for matching with preg_match_all, I want to match such things like image name, image alt text, image title in construct like this: html... div class=class style=style img

Re: [PHP] regular expression, image, name, alt, title, preg_match_all

2003-12-01 Thread Adam i Agnieszka Gasiorowski FNORD
Sophie Mattoug wrote: Sophie Mattoug wrote: Adam i Agnieszka Gasiorowski FNORD wrote: I'm trying to develop a regex for matching with preg_match_all, I want to match such things like image name, image alt text, image title in construct like this: html... div

Re: [PHP] Regular Expression Help: genreate alphanumeric, 8 chars

2003-11-28 Thread David T-G
Adam -- ...and then Adam i Agnieszka Gasiorowski FNORD said... % ... % How about, % % $password = strtolower(substr(md5(uniqid(time())), 0, 7)); Hey, that's pretty slick. Good one! Gonna have to remember that; it's an excellent trick. Thanks HAND :-D -- David T-G

Re: [PHP] Regular expression tutorial

2003-11-27 Thread Jeroen Serpieters
This should do it, also check the links on the left. http://php.net/manual/nl/pcre.pattern.syntax.php Citeren [EMAIL PROTECTED] [EMAIL PROTECTED]: Hi, I see from the postings that I should learn Regular Expressions quite fast. Is there somewhere a decent online tutorial you could

Re: [PHP] Regular Expression Help: genreate alphanumeric, 8 chars

2003-11-27 Thread David T-G
Shaun -- [No need to post twice...] ...and then Shaun said... % % Hi, Hi! % % I need to generate a lowercase alphanumeric passwrord thats 8 characters % long, has anyone got a function that can do this? This isn't really a regular expression question, since you'd use an expression to check

Re: [PHP] Regular Expression Help: genreate alphanumeric, 8 chars

2003-11-27 Thread Bogdan Stancescu
...as in... ? // Could've been done with ASCII sets, but this way // you can easily tweak the eligible characters. $eligible='abcdefghijklmnopqrstuvwxyz0123456789'; $pwdLen=8; $password=''; for($i=0;$i$pwdLen;$i++) { $password.=$eligible[rand(0,strlen($eligible))]; } echo(Your

Re: [PHP] Regular Expression Help: genreate alphanumeric, 8 chars

2003-11-27 Thread David T-G
Bogdan -- ...and then Bogdan Stancescu said... % % ...as in... % % ? % // Could've been done with ASCII sets, but this way % // you can easily tweak the eligible characters. % $eligible='abcdefghijklmnopqrstuvwxyz0123456789'; % $pwdLen=8; % $password=''; % for($i=0;$i$pwdLen;$i++) {

Re: [PHP] Regular Expression Help: genreate alphanumeric, 8 chars

2003-11-27 Thread Burhan Khalid
Shaun wrote: Hi, I need to generate a lowercase alphanumeric passwrord thats 8 characters long, has anyone got a function that can do this? No, but I can write a quick one for you. Can't guarantee the uniqueness of the password being generated. function passgen() { srand((float) microtime()

Re: [PHP] Regular Expression Help: genreate alphanumeric, 8 chars

2003-11-27 Thread Adam i Agnieszka Gasiorowski FNORD
David T-G wrote: Bogdan -- ...and then Bogdan Stancescu said... % % ...as in... % % ? % // Could've been done with ASCII sets, but this way % // you can easily tweak the eligible characters. % $eligible='abcdefghijklmnopqrstuvwxyz0123456789'; % $pwdLen=8; % $password='';

RE: [PHP] Regular expression help

2003-11-25 Thread Bronislav Kluka
This condition is true if there is no space, new line or tabulator in $val I need someone to tell me exactly what this regular-expression means: if(ereg([^ \t\n],$val)) { // do the job here } I'm looking for an intermittent bug, and I need to understand this to make sure I have found

Re: [PHP] Regular expression help

2003-11-25 Thread Ben
Thanks Bronislav for your answer but this can't be it as the following test code passes validation: ?Php $val = \t test \n; if(ereg([^ \t\n],$val)) { echo 'In here!!'; } echo 'BR' . nl2br($val); ? Anyone has an idea? Bronislav kluèka [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

Re: [PHP] Regular expression help

2003-11-25 Thread Matthias Nothhaft
Hi, ^ inside [] means not the following chars, so your expression means: if ($val contains no space , no tab \t and no newline \n) { //do the job ... } Regards, Matthias Ben wrote: I need someone to tell me exactly what this regular-expression means: if(ereg([^ \t\n],$val)) { //

Re: [PHP] Regular expression help

2003-11-25 Thread CPT John W. Holmes
From: Bronislav Kluka [EMAIL PROTECTED] I need someone to tell me exactly what this regular-expression means: if(ereg([^ \t\n],$val)) { // do the job here This condition is true if there is no space, new line or tabulator in $val Actually, the regular expression will match anything

Re: [PHP] Regular expression help

2003-11-25 Thread Ben
That's it! Thank you very much, you have the answer. I wonder why the programmer did not write the following line instead: if (strlen(trim($val))) { // Do the job here } Anyways, you just proved that I did not fix the bug! Now I have to work even more! :-P Thanks Matthias Nothhaft [EMAIL

Re: [PHP] Regular expression help

2003-11-25 Thread Curt Zirzow
* Thus wrote Matthias Nothhaft ([EMAIL PROTECTED]): Hi, ^ inside [] means not the following chars, so your expression means: if ($val contains no space , no tab \t and no newline \n) { //do the job ... } That's not necessarily the correct assesment. rather: if ($val has any

Re: [PHP] Regular Expression

2003-08-14 Thread Jason Wong
On Tuesday 05 August 2003 04:19, Ralph Guzman wrote: Been working on this one for a while but can't get it working properly. I need a regular expression to match if address is 1. PO Box 2. P.O. Box 3. P.O.Box I'm using /i to make this case insensitive. I got it working with 1 2, but

RE: [PHP] Regular Expression

2003-08-04 Thread Jennifer Goodie
Been working on this one for a while but can't get it working properly. I need a regular expression to match if address is 1. PO Box 2. P.O. Box 3. P.O.Box I got it working with 1 2, but it's still not matching 3. Any suggestions? if(preg_match( /p[\.]o\.* +box/i,

Re: [PHP] Regular Expression

2003-08-04 Thread Jon Drukman
At 02:45 PM 8/4/2003, Ralph Guzman wrote: Been working on this one for a while but can't get it working properly. I need a regular expression to match if address is 1. PO Box 2. P.O. Box 3. P.O.Box I'm using /i to make this case insensitive. I got it working with 1 2, but it's still not matching

Re: [PHP] Regular expression question

2003-08-04 Thread Jim Lucas
well, first off '' should not be allowed as a value of an attr= pair anyways. You should convert it to gt; or lt; this will solve that problem. Jim Lucas - Original Message - From: Dan Phiffer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 04, 2003 4:03 PM Subject: [PHP]

Re: [PHP] Regular expression question

2003-08-04 Thread Dan Phiffer
Actually, this is for a general purpose templating that might use and or [ and ] (i.e. [element attribute=value]), but I suppose the same character entity requirement could be applied to other boundary characters. Somehow it didn't occur to me. Thanks for the response, -Dan Jim Lucas [EMAIL

Re: [PHP] Regular Expression

2003-08-04 Thread Curt Zirzow
* Thus wrote Ralph Guzman ([EMAIL PROTECTED]): Been working on this one for a while but can't get it working properly. I need a regular expression to match if address is 1. PO Box 2. P.O. Box 3. P.O.Box I'm using /i to make this case insensitive. /p\.?o\.?\s*box/i I got it working

RE: [PHP] REGULAR EXPRESSION HELP

2003-07-14 Thread Ford, Mike [LSS]
-Original Message- From: John [mailto:[EMAIL PROTECTED] Sent: 12 July 2003 07:31 I need to match a pattern, not in a single-line but from a HTML page, which obviously has loads of lines. I need to match 2 lines from this HTML page: 1) HTMLTITLEFirstVariable - Second

Re: [PHP] REGULAR EXPRESSION HELP

2003-07-12 Thread John W. Holmes
John wrote: I need to match a pattern, not in a single-line but from a HTML page, which obviously has loads of lines. I need to match 2 lines from this HTML page: 1) HTMLTITLEFirstVariable - Second Variable/TITLE/HTML 2) TABLETDTR(newline) ThirdVariable/TR/TD/TABLE... I tried this code: 1)

<    1   2   3   4   >