Re: [PHP] Regular Expression help

2007-01-04 Thread Jochem Maas
Arpad Ray wrote: Note that $ allows a trailing newline, but \z doesn't. I had to test that before believing you: php -r 'var_dump(preg_match(#^[a-z]+\$#,abc),preg_match(#^[a-z]+\$#,abc\n),preg_match(#^[a-z]+\z#,abc\n));' you are right, that could consitute a nice big gotcha in some

[PHP] Regular expression to find from start of string to first space

2006-08-08 Thread Dave M G
PHP, Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: The enclosing has marks, #, I *think* just encloses the

Re: [PHP] Regular expression to find from start of string to first space

2006-08-08 Thread David Tulloh
Dave M G wrote: PHP, Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: The enclosing has marks, #, I

Re: [PHP] Regular expression to find from start of string to first space

2006-08-08 Thread Dave Goodchild
On 08/08/06, Dave M G [EMAIL PROTECTED] wrote: PHP, Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: . stands for

Re: [PHP] Regular expression to find from start of string to first space

2006-08-08 Thread Richard Lynch
On Tue, August 8, 2006 4:21 am, Dave M G wrote: Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: The enclosing

Re: [PHP] Regular expression to find from start of string to first space [SOLVED]

2006-08-08 Thread Dave M G
Richard, Adam, Barry, Dave, David, Thank you all for your helpful advice regarding expressions. I was able to combine all your advice, and made some additional discoveries along the way. The winning expression is: #^(.*)\s#iU First, I discovered that sometimes the source text had an

[PHP] regular expression to extract from the middle of a string

2006-07-14 Thread Steve Turnbull
Hey folks I don't want to just get you to do the work, but I have so far tried in vain to achieve something... I have a string similar to the following; cn=emailadmin,ou=services,dc=domain,dc=net I want to extract whatever falls between the 'cn=' and the following comma - in this case

Re: [PHP] regular expression to extract from the middle of a string

2006-07-14 Thread Dave Goodchild
On 14/07/06, Steve Turnbull [EMAIL PROTECTED] wrote: Hey folks I don't want to just get you to do the work, but I have so far tried in vain to achieve something... I have a string similar to the following; cn=emailadmin,ou=services,dc=domain,dc=net I want to extract whatever falls between

Re: [PHP] regular expression to extract from the middle of a string

2006-07-14 Thread tg-php
I believe someone gave the regex code for it already, but if you wanted to do it the clumsy way (for those of us who are regex challenged still) here's an alternative: $str = cn=emailadmin,ou=services,dc=domain,dc=net; $argsarray = explode(,, $str); foreach ($argsarray as $argstr) {

Re: [PHP] regular expression to extract from the middle of a string

2006-07-14 Thread Kim Christensen
On 7/14/06, Steve Turnbull [EMAIL PROTECTED] wrote: I have a string similar to the following; cn=emailadmin,ou=services,dc=domain,dc=net I want to extract whatever falls between the 'cn=' and the following comma - in this case 'emailadmin'. $pattern= /[^=]+=([^,]+)/; preg_match($pattern,

Re: [PHP] regular expression to extract from the middle of a string

2006-07-14 Thread Russell Jones
Ill probably get attacked viciously for this with pitchforks and machetes, but I get sick and tired of trying to figure out regular expressions a lot of times, so I use the following functions... getSingleMatch(), getMultiMatch(), getSingleMatchBackwards() function

Re: [PHP] Regular expression

2006-02-15 Thread Robin Vickery
On 2/14/06, Patrick [EMAIL PROTECTED] wrote: Hi, I am trying to validate a password, but havent figured out the pattern for it yet. The password must contain atleast 6 characters a-zA-Z0-9_ must start with a a-zA-Z and must have atleast one of the following characters !#%$£ As Curt

RE: [PHP] Regular expression

2006-02-15 Thread Weber Sites LTD
Monitor http://seo.weberdev.com -Original Message- From: Patrick [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 11:53 PM To: php-general@lists.php.net Subject: [PHP] Regular expression Hi, I am trying to validate a password, but havent figured out the pattern for it yet

Re: [PHP] Regular expression

2006-02-15 Thread Barry
Weber Sites LTD wrote: Check out some Regular Expression code examples To learn more : http://www.weberdev.com/AdvancedSearch.php?searchtype=categorycategory=Rege xps Sincerely berber ZONG! - No results were found. * Run this seach again but include PHP Functions in the

RE: [PHP] Regular expression

2006-02-15 Thread Weber Sites LTD
: [PHP] Regular expression Weber Sites LTD wrote: Check out some Regular Expression code examples To learn more : http://www.weberdev.com/AdvancedSearch.php?searchtype=categorycategor y=Rege xps Sincerely berber ZONG! - No results were found. * Run this seach again

[PHP] Regular expression

2006-02-14 Thread Patrick
Hi, I am trying to validate a password, but havent figured out the pattern for it yet. The password must contain atleast 6 characters a-zA-Z0-9_ must start with a a-zA-Z and must have atleast one of the following characters !#%$£ correct passwords would be: a#aAb08 Plkpod! t09_#8T U_p#q#Pq i

Re: [PHP] Regular expression

2006-02-14 Thread Dennis Lahay
Patrick, http://regexlib.com/ is a really good site to find examples of regular expressions. http://regexlib.com/Search.aspx?k=password should get you a bunch of results. Also anything else besides letters and numbers is considered bad password form. D On Feb 14, 2006, at 3:53 PM,

Re: [PHP] Regular expression

2006-02-14 Thread Curt Zirzow
On Tue, Feb 14, 2006 at 10:53:17PM +0100, Patrick wrote: Hi, I am trying to validate a password, but havent figured out the pattern for it yet. The password must contain atleast 6 characters a-zA-Z0-9_ must start with a a-zA-Z and must have atleast one of the following characters !#%$�

Re: [PHP] Regular expression

2006-02-03 Thread Richard Lynch
$last_comma = strrpos($string, ,); $string = substr($string, 0, $last_comma) . ' and ' . substr($string, $last_comma); I probably have a one-off error in there somewhere, or swapped the order of args in strrpos, but you get the idea. http://php.net/strrpos On Mon, January 30, 2006 8:09 am, Barry

RE: [PHP] Regular expression

2006-02-03 Thread php-mail
commas or neither... preserves spaces Hope this one works (and that I've read the post right :-/) Dan -- -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: 03 February 2006 23:34 To: Barry Cc: php-general@lists.php.net Subject: Re: [PHP] Regular expression $last_comma

[PHP] Regular expression

2006-01-30 Thread Barry
Simple reg help please i want to match the last , in a,b,c,d and replace it with and i tried ereg_replace(,([a-zA-z])*$, and ,$string); but i forgot how to add the d which is also matched now back to the and Can you give any good reg_exp sites where to learn it? Its long ago since i used

Re: [PHP] Regular expression

2006-01-30 Thread Silvio Porcellana [tradeOver]
Barry wrote: Simple reg help please i want to match the last , in a,b,c,d and replace it with and Without using a regexp, you could do: code $string = 'a,b,c,d'; $letters = explode(',', $string); $last_letter = array_pop($letters); $final_string = implode(',', $letters) . ' and '

[PHP] Regular Expression help

2006-01-19 Thread Chris Boget
I've been beating my head against the wall for a while trying to come up with the RE I need to use. I have a camel case word - let's use JimJoeBobBriggs. I need to come up with a RE that will fine all the upper case characters and insert an underscore prior to those characters with the exception

Re: [PHP] Regular Expression help

2006-01-19 Thread Richard Heyes
Chris Boget wrote: I've been beating my head against the wall for a while trying to come up with the RE I need to use. I have a camel case word - let's use JimJoeBobBriggs. I need to come up with a RE that will fine all the upper case characters and insert an underscore prior to those

Re: [PHP] Regular Expression help

2006-01-19 Thread Robin Vickery
On 1/19/06, Chris Boget [EMAIL PROTECTED] wrote: I've been beating my head against the wall for a while trying to come up with the RE I need to use. I have a camel case word - let's use JimJoeBobBriggs. I need to come up with a RE that will fine all the upper case characters and insert an

Re: [PHP] Regular Expression help

2006-01-19 Thread Chris
Chris Boget wrote: I've been beating my head against the wall for a while trying to come up with the RE I need to use. I have a camel case word - let's use JimJoeBobBriggs. I need to come up with a RE that will fine all the upper case characters and insert an underscore prior to those

Re: [PHP] Regular Expression help

2006-01-19 Thread John Nichel
Chris Boget wrote: I've been beating my head against the wall for a while trying to come up with the RE I need to use. I have a camel case word - let's use JimJoeBobBriggs. I need to come up with a RE that will fine all the upper case characters and insert an underscore prior to those

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

[PHP] regular expression for integer range

2005-09-06 Thread babu
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 allowed.

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

[PHP] regular expression for time

2005-08-29 Thread babu
HI, how can i write regular expression for time in 24-hour format i:e, HH:MM:SS. using preg_match. thanks babu - How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos. Get Yahoo! Photos

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

[PHP] Regular expression question

2005-08-11 Thread Leon Vismer
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)/, /([a-z]+)([A-Z])/ ); $replace = array( \$1_id,

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',

[PHP] Regular expression help

2005-08-02 Thread David Christensen
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 123-456-7890 OR $phone could be (123)

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.

[PHP] Regular Expression to replace pseudo-HTML?

2005-04-20 Thread Murray @ PlanetThoughtful
Hi All, 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. An example of a source string

[PHP] Regular expression. What is wrong?

2005-02-14 Thread Kostyantyn Shakhov
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: ereg(): REG_ERANGE and the

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:

[PHP] regular expression help

2005-01-21 Thread Jason
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. 00:AA:11:BB:22:CC */ function chk_mac( $mac ) { if( eregi(

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

[PHP] Regular Expression

2004-11-24 Thread ankur_os
Hi, This is quite simpal problem that i want to made regular expression which can read this kind of structure... a,b,c not like this 1. ,a,a,a 2. a,,,aa,, 3. a,a,a,,, means simpal structure with comma (a,b,c...) Thnx Ankur -- PHP General Mailing List (http://www.php.net/) To

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

[PHP] Regular Expression for a UK Mobile

2004-10-15 Thread Shaun
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 long, be

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

[PHP] Regular expression

2004-10-07 Thread Alawi Albaity
How can I grap number written in specifec place in html I try this : preg_match_all(/ TR TD bgColor=#e4e4e4 PBtest:\/B\/P\/TD TD P(*[0-9])\/P\/TD\/TR TR/,$html,$match);

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

[PHP] Regular Expression - highlighting

2004-10-02 Thread Aidan Lister
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 pretty sure a lookbehind

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

[PHP] regular expression help

2004-09-28 Thread Ed Lazor
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 Enterprise. /complain Unfortunately, I now have a bunch of

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:

[PHP] Regular Expression: Markup Code

2004-09-13 Thread [ rswfire ]
Hello, would someone please help me with my regular expressions? They are so complex! Here is what I need to do. I have a string with contents similar to the following: BLOCK NAME=TOP (a bunch of markup code) /BLOCK BLOCK NAME=BOTTOM (a bunch of markup code)

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)

[PHP] Regular expression help

2004-09-09 Thread Skippy
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). -- Romanian Web Developers - http://ROWD.ORG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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

[PHP] Regular expression help

2004-08-25 Thread Daniel Lahey
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 on the web for

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

[PHP] regular expression

2004-07-02 Thread George Lantz
Could someone help me with a regular expression? I am not very good at them. I want to find the following pattern inside a file: [%string%] Then extract the string portion to store in array. I would next like to replace those patterns with html code. That's right you guessed it a template

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

[PHP] Regular expression

2004-06-30 Thread Syed Ghouse
Hi All (B (Bwill anyone give me a solution to get the name and email address of sender from the (Bmail text below using regular expression. (B (BThe result shud get (Bname as syed ghouse (Band (Bemail as [EMAIL PROTECTED] (B (B--- Mail text start --- (B (BReturn-Path: [EMAIL

[PHP] Regular Expression Help

2004-06-30 Thread Pablo Gosse
Hi folks. I'm having a little bit of a stupid moment with a regular expression which I'm hoping someone can lend a hand with. The regular expression I have right now matches strings between 2 and 1000 characters in length that start with one of the following characters: a-z A-Z 0-9 ( ) and

[PHP] Regular Expression Help

2004-06-30 Thread Pablo Gosse
Howdy folks. Sorry for the message which just showed up truncated. It's complete in my sent mail, but appeared truncated on the list. Full message is below. TIA for all help. Hi folks. I'm having a little bit of a stupid moment with a regular expression which I'm hoping someone can lend a

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

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

2004-06-14 Thread Ulrik S. Kofod
$replace = /^(([a-z]+?[^a-z]+?){.($count).})(.$typedmask.)(.*)/iS; $with = $1error-start sourcetext=.$corr['sourcetext']. id=.$corr['id']. group=\.$corr['grupper'].\ class=\.$corr['ordklasse'].\ corrected-from=\.$corr['typed'].\ corrected-to=\.$corr['corrected'].\$3error-end

[PHP] Regular expression question

2004-05-27 Thread Dan Phiffer
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 opening bracket, so that it's possible to do \[that] without having

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

[PHP] Regular Expression

2004-05-18 Thread Chris Boget
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 -- PHP General Mailing List

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]
- EAS Business Intelligence [EMAIL PROTECTED] -Original Message- From: Tumurbaatar S. [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 12:26 AM To: [EMAIL PROTECTED] Subject: [PHP] Regular Expression There's an input string like {str1,str2,...,strN}. I want to capture all

[PHP] Regular Expression

2004-05-04 Thread Tumurbaatar S.
There's an input string like {str1,str2,...,strN}. I want to capture all these strings and due to complexity of them I use a preg_match_all() instead of simple split. A pattern for the matching strings is ready but I cannot imagine how to specify that strings are separated by commas and the last

[PHP] Regular Expression for a UK mobile phone number

2004-04-08 Thread Shaun
Hi, 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! $regexp = /447[0-9]{9}/;

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}/;

<    1   2   3   4   5   >