Re: [PHP] regex and global vars problem

2005-10-27 Thread Tom Rogers
Hi, Thursday, October 27, 2005, 3:15:30 AM, you wrote: JG I am having a problem with a couple of function I have written to check JG for a type of string, attempt to fix it and pass it back to the main JG function. Any help is appreciated. I would do it with a small class like this: ?php class

[PHP] regex and global vars problem

2005-10-26 Thread Jason Gerfen
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(

Re: [PHP] regex and global vars problem

2005-10-26 Thread Jasper Bryant-Greene
On Wed, 2005-10-26 at 11:15 -0600, 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. [snip] Would you mind telling us what the problem was? --

Re: [PHP] regex and global vars problem

2005-10-26 Thread Jason Gerfen
Um I did actually, but I will re-interate the problem with more detail. the vars $mac1, $mac2, $mac3 are to get passed to the chk_mac() function which determines if it is a valid hex representation of a h/w address, if it does not meet the criteria of having a : separating every two

Re: [PHP] regex and global vars problem

2005-10-26 Thread Jasper Bryant-Greene
On Wed, 2005-10-26 at 12:07 -0600, Jason Gerfen wrote: Um I did actually, but I will re-interate the problem with more detail. the vars $mac1, $mac2, $mac3 are to get passed to the chk_mac() function which determines if it is a valid hex representation of a h/w address, if it does not

Re: [PHP] regex and global vars problem

2005-10-26 Thread Jason Gerfen
The code I just showed you is supposed to do the following, the chk_mac() returns a true or false on the vars $mac1, $mac2 and $mac3. $mac3 is the only var that should not be thrown into the fix_mac() function which is working correctly. The problem is when $mac1 and $mac2 get put into the

Re: [PHP] regex and global vars problem

2005-10-26 Thread Jasper Bryant-Greene
On Wed, 2005-10-26 at 12:24 -0600, Jason Gerfen wrote: The code I just showed you is supposed to do the following, the chk_mac() returns a true or false on the vars $mac1, $mac2 and $mac3. $mac3 is the only var that should not be thrown into the fix_mac() function which is working

Re: [PHP] regex and global vars problem

2005-10-26 Thread Jochem Maas
gonna jump on your thread there Jasper, I would like to comment on your function and ask you a question: which is 'better' (for what), preg_*() or ereg[i]*()? Jasper Bryant-Greene wrote: On Wed, 2005-10-26 at 12:24 -0600, Jason Gerfen wrote: The code I just showed you is supposed to do the

Re: [PHP] RegEx - Is this right?

2005-10-16 Thread Al Hafoudh
yes, it is equal, but i'd rather use file() function Gustav Wiberg wrote: Hi there! I want to get conents of a file and split into a array... $s = file_get_contents($fileName); $splitS = preg_split(/\n/,$s); Is this equal to using $splitS = file($fileName) ? /G

[PHP] RegEx - Is this right?

2005-10-15 Thread Gustav Wiberg
Hi there! I want to get conents of a file and split into a array... $s = file_get_contents($fileName); $splitS = preg_split(/\n/,$s); Is this equal to using $splitS = file($fileName) ? /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

[PHP] Regex Help

2005-09-28 Thread Pablo Gosse
Hi, folks. I'm having trouble with a simple regex. I'm sure it's just something small that I'm missing but nothing I'm trying is working. In an HTML file I have comments like this: !-- START PRINT -- various html crap here !-- END PRINT -- Here's the regex I'm using: /!-- START PRINT

Re: [PHP] Regex Help

2005-09-28 Thread Philip Hallstrom
Hi, folks. I'm having trouble with a simple regex. I'm sure it's just something small that I'm missing but nothing I'm trying is working. In an HTML file I have comments like this: !-- START PRINT -- various html crap here !-- END PRINT -- Here's the regex I'm using: /!-- START PRINT

RE: [PHP] Regex Help

2005-09-28 Thread Murray @ PlanetThoughtful
Hi, folks. I'm having trouble with a simple regex. I'm sure it's just something small that I'm missing but nothing I'm trying is working. In an HTML file I have comments like this: !-- START PRINT -- various html crap here !-- END PRINT -- Here's the regex I'm using: /!-- START

RE: [PHP] Regex Help

2005-09-28 Thread Pablo Gosse
Greetings folks. Thanks Murray and Philip for the quick responses. Adding the /s modifier worked perfectly. Cheers, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] REGEX Help Please

2005-09-19 Thread Shaun
Hi, 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}/; Can anyone help here please? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] REGEX Help Please

2005-09-19 Thread John Nichel
Shaun wrote: Hi, 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}/; Can anyone help here please? Thanks May have to go outside just a regex... if ( preg_match (

Re: [PHP] REGEX Help Please

2005-09-19 Thread Robert Cummings
On Mon, 2005-09-19 at 10:11, John Nichel wrote: Shaun wrote: Hi, 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}/; Can anyone help here please? Thanks

Re: [PHP] REGEX Help Please

2005-09-19 Thread Stephen Leaf
On Monday 19 September 2005 09:03 am, Shaun wrote: Hi, 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}/; Can anyone help here please? Thanks $regexp =

[PHP] regex

2005-09-08 Thread Merlin
Hi there, I would like to create a regex which only executes if the client does not come from a specified IP adress. Any ideas how to place this into the Rewrite Rule regex?: RewriteRule ^(.*)$ Thank you for any help on that, Merlin -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] regex

2005-09-08 Thread Jasper Bryant-Greene
Merlin wrote: I would like to create a regex which only executes if the client does not come from a specified IP adress. Any ideas how to place this into the Rewrite Rule regex?: What does this have to do with PHP? http://www.google.com/search?q=regular+expression The top four or five

Re: [PHP] regex

2005-09-08 Thread John Nichel
Merlin wrote: Hi there, I would like to create a regex which only executes if the client does not come from a specified IP adress. Any ideas how to place this into the Rewrite Rule regex?: I'm betting members of the Apache mailing list know. -- John C. Nichel ÜberGeek KegWorks.com

RE: [PHP] REGEX for query

2005-08-11 Thread Jay Blanchard
[snip] Assuming unix, I'd do the following from the root of the application to get a list of files that contain queries: $ egrep =[:space:]*\.*\b(SELECT|INSERT|UPDATE)\b * -ril ... Anyway, that's how I'd do it. Hope you got something out of this... :) [/snip] That is a good start, now all I

Re: [PHP] REGEX for query

2005-08-11 Thread Robin Vickery
On 8/11/05, Jay Blanchard [EMAIL PROTECTED] wrote: That is a good start, now all I need to do is get the whole query(s) Get them from the mysql logs? -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] REGEX for query

2005-08-11 Thread Jay Blanchard
[snip] That is a good start, now all I need to do is get the whole query(s) Get them from the mysql logs? [/snip] While that sounds like a good idea there are two things that hamper the effectiveness of this is a total solution; 1. The logs have many queries from other applications that

RE: [PHP] REGEX for query

2005-08-11 Thread Michael Sims
Jay Blanchard wrote: [snip] Assuming unix, I'd do the following from the root of the application to get a list of files that contain queries: $ egrep =[:space:]*\.*\b(SELECT|INSERT|UPDATE)\b * -ril ... Anyway, that's how I'd do it. Hope you got something out of this... :) [/snip] That

[PHP] REGEX for query

2005-08-10 Thread Jay Blanchard
('stinky' == $caca){ $variableName .= AND poot = ' . $caca['texture'] . ' ; } How would you begin to get the queries using PHP? Regex? Other methods? I am working on isolating where the applications live right now, but I would be thrilled to read your opinions and methods. Thanks! -- PHP General

RE: [PHP] REGEX for query

2005-08-10 Thread Michael Sims
as [...] How would you begin to get the queries using PHP? Regex? Other methods? I am working on isolating where the applications live right now, but I would be thrilled to read your opinions and methods. Assuming unix, I'd do the following from the root of the application to get a list

Re: [PHP] Regex help

2005-08-07 Thread Dotan Cohen
On 8/4/05, Lizet Pena de Sola [EMAIL PROTECTED] wrote: Ok, it's not the regexp for detecting email addresses what I need, that's widely published, thanks. I'm using ereg to match this regular expression: (On)[\s\w\d\W\S\D\n]*(wr[i|o]te[s]?:) That will match phrases like On 8/3/05, Carol

RE: [PHP] Regex help

2005-08-04 Thread Lizet Pena de Sola
: Marcus Bointon [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 03, 2005 8:57 AM To: PHP General Subject: Re: [PHP] Regex help On 2 Aug 2005, at 15:12, Robin Vickery wrote: I don't suppose this is the place for a rant about the futility of checking email addresses with a regexp? Though I

Re: [PHP] Regex help

2005-08-03 Thread Marcus Bointon
On 2 Aug 2005, at 15:12, Robin Vickery wrote: I don't suppose this is the place for a rant about the futility of checking email addresses with a regexp? Though I will agree with you to some extent, I've had quite a lot of success with this, which is pretty thorough:

[PHP] Regex help

2005-08-02 Thread Chris Boget
I'm trying to validate an email address and for the life of me I cannot figure out why the following regex is not working: script language=php $email = [EMAIL PROTECTED]; $regex =

Re: [PHP] Regex help

2005-08-02 Thread Robin Vickery
On 8/2/05, Chris Boget [EMAIL PROTECTED] wrote: I'm trying to validate an email address and for the life of me I cannot figure out why the following regex is not working: $email = [EMAIL PROTECTED]; $regex =

Re: [PHP] Regex help

2005-08-02 Thread Dotan Cohen
On 8/2/05, Robin Vickery [EMAIL PROTECTED] wrote: I don't suppose this is the place for a rant about the futility of checking email addresses with a regexp? -robin Let Richard Lynch tell him. He's good at regex's, and it's HIS email address that never makes it through! Dotan Cohen

[PHP] Regex help

2005-06-06 Thread RaTT
Hi Guys, I am currently creating a once off text parser for a rather large document that i need to strip out bits of information on certain lines. The line looks something like : Adress line here, postcode, country Tel: +27 112233665 Fax: 221145221 Website: http://www.urlhere.com E-Mail:

Re: [PHP] Regex help

2005-06-06 Thread Philip Hallstrom
I am currently creating a once off text parser for a rather large document that i need to strip out bits of information on certain lines. The line looks something like : Adress line here, postcode, country Tel: +27 112233665 Fax: 221145221 Website: http://www.urlhere.com E-Mail: [EMAIL

RE: [PHP] Regex question: replacing incidences of character when not enclosed within HTML tags? (somewhat solved)

2005-05-29 Thread Murray @ PlanetThoughtful
So, thinking about it a little more, I decided what I was looking for was a regular expression that would allow me to replace any incidences of hyphens when not contained within tags (i.e., when not contained between and ). And this is where things have ground to a halt. Hi All, After

[PHP] Regex question: replacing incidences of character when not enclosed within HTML tags?

2005-05-28 Thread Murray @ PlanetThoughtful
Hi All, I have content that contains several lengthy hyphenated sentences, such as: This-is-a-sentence-in-which-all-the-words-are-hyphenated. I've noticed that some (maybe all?) browsers, particularly Firefox, will not wrap long strings of hyphenated words when they are contained in a DIV tag

Re: [PHP] Regex nightmares

2005-05-24 Thread Richard Lynch
On Mon, May 23, 2005 8:43 am, W Luke said: I really struggle with regex, and would appreciate some guidance. Basically, I have a whole load of files (HTML) which are updated every few minutes. I need to go through each line, looking for the word CONFIRMED: (which is always in capitals, and

RE: [PHP] Regex nightmares

2005-05-24 Thread Murray @ PlanetThoughtful
[Course, when you *DO* need RegEx it's *more* than a bit of a headache. More like a migraine :-)] One of these days I will truly master regular expressions. After that, enlightenment should be easy. Regards, Murray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Regex nightmares

2005-05-23 Thread W Luke
Hi, I really struggle with regex, and would appreciate some guidance. Basically, I have a whole load of files (HTML) which are updated every few minutes. I need to go through each line, looking for the word CONFIRMED: (which is always in capitals, and always superseded by a colon). The line

Re: [PHP] Regex nightmares

2005-05-23 Thread John Nichel
W Luke wrote: Hi, I really struggle with regex, and would appreciate some guidance. Basically, I have a whole load of files (HTML) which are updated every few minutes. I need to go through each line, looking for the word CONFIRMED: (which is always in capitals, and always superseded by a

Re: [PHP] Regex nightmares

2005-05-23 Thread Philip Hallstrom
On Mon, 23 May 2005, W Luke wrote: Hi, I really struggle with regex, and would appreciate some guidance. Basically, I have a whole load of files (HTML) which are updated every few minutes. I need to go through each line, looking for the word CONFIRMED: (which is always in capitals, and always

Re: [PHP] Regex nightmares

2005-05-23 Thread phpninja
W Luke wrote: Hi, I really struggle with regex, and would appreciate some guidance. Basically, I have a whole load of files (HTML) which are updated every few minutes. I need to go through each line, looking for the word CONFIRMED: (which is always in capitals, and always superseded

Re: [PHP] regex question

2005-05-17 Thread Petar Nedyalkov
On Monday 16 May 2005 22:53, Al wrote: What pattern can I use to match ONLY single occurrences of a character in a string. e.g., Some text @ and some mo@@re and [EMAIL PROTECTED], etc @@@. Use the following: /(^@)(@{1})(^@)/ This way you'll be sure the regexp will match only single

Re: [PHP] regex question

2005-05-17 Thread Al
Murry's solution here is ideal since it only captures the single occurrence. Since I want to use it for a preg_replace(), it is perfect. A couple of folks sent this pattern [EMAIL PROTECTED]@[EMAIL PROTECTED]; but, it doesn't work because I then have to remove the unwanted caracters on either

[PHP] regex question

2005-05-16 Thread Al
What pattern can I use to match ONLY single occurrences of a character in a string. e.g., Some text @ and some mo@@re and [EMAIL PROTECTED], etc @@@. I only want the two occurrences with a single occurrence of @. @{1} doesn't work; there are 4 matches. Thanks -- PHP General Mailing List

Re: [PHP] regex question

2005-05-16 Thread Brandon Ryan
Try (for example if character was A) ... ([^A]|^)A([^A]|$) This matches four cases: A is at beginning of string and there is another letter after it, A has a letter before it and a letter after it, A is at end of string and there is a letter before it, or A is the only character in the string.

Re: [PHP] regex question

2005-05-16 Thread Philip Hallstrom
On Mon, 16 May 2005, Al wrote: What pattern can I use to match ONLY single occurrences of a character in a string. e.g., Some text @ and some mo@@re and [EMAIL PROTECTED], etc @@@. I only want the two occurrences with a single occurrence of @. [EMAIL PROTECTED]@[EMAIL PROTECTED] should do it I

RE: [PHP] regex question

2005-05-16 Thread Murray @ PlanetThoughtful
What pattern can I use to match ONLY single occurrences of a character in a string. e.g., Some text @ and some mo@@re and [EMAIL PROTECTED], etc @@@. I only want the two occurrences with a single occurrence of @. @{1} doesn't work; there are 4 matches. /[EMAIL PROTECTED]@[EMAIL

RE: [PHP] regex question

2005-05-16 Thread Murray @ PlanetThoughtful
What pattern can I use to match ONLY single occurrences of a character in a string. e.g., Some text @ and some mo@@re and [EMAIL PROTECTED], etc @@@. I only want the two occurrences with a single occurrence of @. @{1} doesn't work; there are 4 matches. Thanks Please ignore my

RE: [PHP] regex question

2005-05-16 Thread Murray @ PlanetThoughtful
Try (for example if character was A) ... ([^A]|^)A([^A]|$) This matches four cases: A is at beginning of string and there is another letter after it, A has a letter before it and a letter after it, A is at end of string and there is a letter before it, or A is the only character in the

Re: [PHP] regex question

2005-05-16 Thread Jason Barnett
?php $text = 'Some text @ and some mo@@re and [EMAIL PROTECTED], etc @@@.'; /** Word boundaries before and after @ */ $regex = '/[EMAIL PROTECTED]/'; preg_match_all($regex, $text, $matches); var_dump($matches); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] regex

2005-05-05 Thread Petar Nedyalkov
On Wednesday 04 May 2005 21:31, Sebastian wrote: very new to regex i have a string with bbcode such as [img=XXX] (XXX being numeric) how do i search the string for the value of the bbcode and compare it to another variable? so i can take XXX and compare it to $image dynamically. Try this

[PHP] regex

2005-05-04 Thread Sebastian
very new to regex i have a string with bbcode such as [img=XXX] (XXX being numeric) how do i search the string for the value of the bbcode and compare it to another variable? so i can take XXX and compare it to $image dynamically. thanks for any help. -- PHP General Mailing List

Re: [PHP] regex

2005-05-04 Thread Sebastian
i partly solved the problem using this regex: $tutorial['pagetext'] = preg_replace_callback('#\[img\]\s*(\d+)\s*\[/img\]#siU', 'image_code_callback', $content['pagetext']); except instead of using [img]foo[/img] i would like to do just [img=foo] any help? Sebastian wrote:

[PHP] RegEx help

2005-04-14 Thread Bosky, Dave
I wanted to create a regex that force a PHP form text field to meet the following requirements: a. Must contain an 1 uppercase letter. [A-Z] b. Must contain 1 digit. [0-9] c. Must be a minimum of 7 characters in length. {7} I'm not sure of how to build the correct syntax for using all 3

Re: [PHP] RegEx help

2005-04-14 Thread Philip Hallstrom
On Thu, 14 Apr 2005, Bosky, Dave wrote: I wanted to create a regex that force a PHP form text field to meet the following requirements: a. Must contain an 1 uppercase letter. [A-Z] b. Must contain 1 digit. [0-9] c. Must be a minimum of 7 characters in length. {7} if ( ereg([A-Z0-9], $field)

Re: [PHP] RegEx help

2005-04-14 Thread M. Sokolewicz
Philip Hallstrom wrote: On Thu, 14 Apr 2005, Bosky, Dave wrote: I wanted to create a regex that force a PHP form text field to meet the following requirements: a. Must contain an 1 uppercase letter. [A-Z] b. Must contain 1 digit. [0-9] c. Must be a minimum of 7 characters in length. {7} if (

Re: [PHP] RegEx help

2005-04-14 Thread Tom Rogers
Hi, Thursday, April 14, 2005, 11:47:13 PM, you wrote: BD I wanted to create a regex that force a PHP form text field to meet the BD following requirements: BD a. Must contain an 1 uppercase letter. [A-Z] BD b. Must contain 1 digit. [0-9] BD c. Must be a minimum of 7 characters in length. {7}

Re: [PHP] RegEx help

2005-04-14 Thread Philip Hallstrom
I wanted to create a regex that force a PHP form text field to meet the following requirements: a. Must contain an 1 uppercase letter. [A-Z] b. Must contain 1 digit. [0-9] c. Must be a minimum of 7 characters in length. {7} if ( ereg([A-Z0-9], $field) strlen($field) = 7 ) { print(We have a

Re: [PHP] RegEx help

2005-04-14 Thread trlists
On 15 Apr 2005 Tom Rogers wrote: BD a. Must contain an 1 uppercase letter. [A-Z] BD b. Must contain 1 digit. [0-9] BD c. Must be a minimum of 7 characters in length. {7} BD I'm not sure of how to build the correct syntax for using all 3 BD requirements together. easier done seperately I

Re: [PHP] Regex

2005-03-21 Thread Richard Lynch
On Sun, March 20, 2005 3:18 pm, Colin Ross said: I'm trying to compress down a php-powered javascript file. In the file i have php run a bunch of loops and foreaches to build huge nested arrays for use in the javascript. Have you considered using PHP to write JavaScript that will build the

[PHP] Regex

2005-03-20 Thread Colin Ross
I'm trying to compress down a php-powered javascript file. In the file i have php run a bunch of loops and foreaches to build huge nested arrays for use in the javascript. Since this will be an often loaded page with ALOT of backend processing, I've decided to compress the file as much as I can

RE: [PHP] Regex help

2005-01-29 Thread Michael Sims
[EMAIL PROTECTED] wrote: OK, this is off-topic like every other regex help post, but I know some of you enjoy these puzzles :) This isn't an exam question, is it? ;) I need a validation regex that will pass a string. The string can be no longer than some maximum length, and it can contain

RE: [PHP] Regex help

2005-01-29 Thread Bret Hughes
On Sat, 2005-01-29 at 08:58, Michael Sims wrote: [EMAIL PROTECTED] wrote: OK, this is off-topic like every other regex help post, but I know some of you enjoy these puzzles :) This isn't an exam question, is it? ;) I need a validation regex that will pass a string. The string can be

RE: [PHP] Regex help

2005-01-29 Thread Michael Sims
Bret Hughes wrote: On Sat, 2005-01-29 at 08:58, Michael Sims wrote: [EMAIL PROTECTED] wrote: 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 characters except two consecutive ampersands () anywhere in the string.

Re: [PHP] Regex help

2005-01-29 Thread kjohnson
Michael Sims wrote: 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 characters except two consecutive ampersands () anywhere in the string. Yup, use this perl regex: /^(?:()(?!)|[^]){1,5}$/ [snip] Hope

[PHP] Regex help

2005-01-28 Thread kjohnson
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 characters except two consecutive ampersands () anywhere in the

Re: [PHP] Regex help

2005-01-28 Thread trlists
On 28 Jan 2005 [EMAIL PROTECTED] wrote: 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 characters except two consecutive ampersands () anywhere in the string. This is an example of something that is easier to

Re: [PHP] Regex help

2005-01-28 Thread kjohnson
[EMAIL PROTECTED] wrote on 01/28/2005 03:19:14 PM: On 28 Jan 2005 [EMAIL PROTECTED] wrote: 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 characters except two consecutive ampersands () anywhere in the

Re: [PHP] Regex help

2005-01-28 Thread Richard Lynch
[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 characters except two consecutive

Re: [PHP] Regex help

2005-01-28 Thread Richard Lynch
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote on 01/28/2005 03:19:14 PM: On 28 Jan 2005 [EMAIL PROTECTED] wrote: 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 characters except two consecutive

Re: [PHP] Regex help

2005-01-28 Thread trlists
On 28 Jan 2005 [EMAIL PROTECTED] wrote: Thanks, Tom. I agree, but not an option at this time - other parts of the design require this to be a regex. It is pretty easy to do with two regexps, one to check the length and another to see if there is a double . Would that work? I don't know

Re: [PHP] Regex help

2005-01-28 Thread kjohnson
[EMAIL PROTECTED] wrote on 01/28/2005 04:13:38 PM: On 28 Jan 2005 [EMAIL PROTECTED] wrote: Thanks, Tom. I agree, but not an option at this time - other parts of the design require this to be a regex. It is pretty easy to do with two regexps, one to check the length and another to

Re: [PHP] regex help

2005-01-15 Thread Jason Morehouse
Mike Ford wrote: Just off the top of my head (and untested!), I'd try something like /b(\s+[^]*)?/ Cheers! Mike That pretty much seems to work the best. Thanks all! -- Jason Morehouse Vendorama - Create your own online store http://www.vendorama.com -- PHP General Mailing List

Re: [PHP] regex help

2005-01-14 Thread Robin Vickery
On Thu, 13 Jan 2005 16:06:32 -0500, Jason Morehouse [EMAIL PROTECTED] wrote: Hello, I normally can take a bit of regex fun, but not this time. Simple enough, in theory... I need to match (count) all of the bold tags in a string, including ones with embedded styles (or whatever else can go

RE: [PHP] regex help

2005-01-14 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -Original Message- From: Jason Morehouse Sent: 13/01/05 21:06 I normally can take a bit of regex fun, but not this time. Simple enough, in theory... I need to match

RE: [PHP] regex help

2005-01-14 Thread Robinson, Matthew
Do you have the example regex so far? I'd suggest maybe b[^r] might just do what you want -Original Message- From: Jason Morehouse [mailto:[EMAIL PROTECTED] Sent: 13 January 2005 21:07 To: php-general@lists.php.net Subject: [PHP] regex help Hello, I normally can take a bit of regex

Re: [PHP] regex help

2005-01-14 Thread Jason Wong
On Friday 14 January 2005 05:06, Jason Morehouse wrote: Simple enough, in theory... I need to match (count) all of the bold tags in a string, including ones with embedded styles (or whatever else can go in there). b and b style=color:red. My attempts keep matching br as well.

Re: [PHP] regex help

2005-01-14 Thread Richard Lynch
Jason Morehouse wrote: Simple enough, in theory... I need to match (count) all of the bold tags in a string, including ones with embedded styles (or whatever else can go in there). b and b style=color:red. My attempts keep matching br as well. I think something not unlike: '/b( .*|)/' The

Re: [PHP] regex help

2005-01-14 Thread Bret Hughes
On Thu, 2005-01-13 at 15:06, Jason Morehouse wrote: Hello, I normally can take a bit of regex fun, but not this time. Simple enough, in theory... I need to match (count) all of the bold tags in a string, including ones with embedded styles (or whatever else can go in there). b and b

[PHP] regex help

2005-01-13 Thread Jason Morehouse
Hello, I normally can take a bit of regex fun, but not this time. Simple enough, in theory... I need to match (count) all of the bold tags in a string, including ones with embedded styles (or whatever else can go in there). b and b style=color:red. My attempts keep matching br as well.

Re: [PHP] regex help

2005-01-13 Thread Jochem Maas
Jason Morehouse wrote: Hello, I normally can take a bit of regex fun, but not this time. Simple enough, in theory... I need to match (count) all of the bold tags in a string, including ones with embedded styles (or whatever else can go in there). b and b style=color:red. My attempts keep

[PHP] Regex Parsing

2004-12-05 Thread [ rswfire ]
I wish to improve upon my regular expression skills. I am creating a journal object that allows me to post my journals online, while at the same time maintaining nine different levels of privacy. For example, if I give a user Level 3 access, then they would be able to see all parts of my entries

[PHP] regex issue

2004-11-30 Thread nate
All I want to do is capture the keyword (array, break, echo, etc) and color it. --- $txt = this is an array('test'); $pattern = /(array|break|echo|continue)([\(.|\s.|\;.])/; echo preg_replace($pattern, 'font color=red$0/font', $txt); This captures

Re: [PHP] regex issue

2004-11-30 Thread Greg Donald
On Tue, 30 Nov 2004 17:18:33 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: All I want to do is capture the keyword (array, break, echo, etc) and color it. I'd do it like this: $source = 'this is a line of text'; $term = 'line'; $text = eregi_replace(($term), font color=red\\1/font,

RE: [PHP] regex issue

2004-11-30 Thread nate
: Re: [PHP] regex issue On Tue, 30 Nov 2004 17:18:33 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: All I want to do is capture the keyword (array, break, echo, etc) and color it. I'd do it like this: $source = 'this is a line of text'; $term = 'line'; $text = eregi_replace(($term), font color

Re: [PHP] regex issue

2004-11-30 Thread Rick Fletcher
[EMAIL PROTECTED] wrote: All I want to do is capture the keyword (array, break, echo, etc) and color it. $txt = this is an array('test'); $pattern = /(array|break|echo|continue)([\(.|\s.|\;.])/; echo preg_replace($pattern, 'font color=red$0/font', $txt); This captures array( though and I just

Re: [PHP] (Regex) not working, take a quick look at it plz?

2004-10-30 Thread Jason Wong
On Friday 29 October 2004 23:12, Ryan A wrote: I totally suck at RegEx (but am trying to learn), I got the following from the web, but its not working for me... can anyone spot what I am doing wrong or whats wrong please? And what *exactly* is wrong? What did you expect the code to do? What

[PHP] (Regex) not working, take a quick look at it plz?

2004-10-29 Thread Ryan A
Hi, I totally suck at RegEx (but am trying to learn), I got the following from the web, but its not working for me... can anyone spot what I am doing wrong or whats wrong please? Its a small script and just around 8 lines are actually important (I think). Its basically something like a template

[PHP] Regex Lookbehind help

2004-10-26 Thread Alex Hogan
Hi All, I am trying to identify an email address in a page but I don't want to return the email if it's [EMAIL PROTECTED] Here's what I have; (\w[-._\w]*\w(?!webmaster)@\w[-._\w]*\w\.\w{2,3}) It returns nothing, however when I take out the lookbehind section; ([EMAIL PROTECTED],3}) it works

RE: [PHP] Regex Lookbehind help

2004-10-26 Thread Michael Sims
Alex Hogan wrote: Hi All, I am trying to identify an email address in a page but I don't want to return the email if it's [EMAIL PROTECTED] Here's what I have; (\w[-._\w]*\w(?!webmaster)@\w[-._\w]*\w\.\w{2,3}) It returns nothing, however when I take out the lookbehind section; ([EMAIL

Re: [PHP] Regex Lookbehind help

2004-10-26 Thread Alex Hogan
I just tried this out and the first regex is actually working for me on php 4.3.8 (cli). Can you post some code? At this point all I'm trying to do is print the array with the addresses. $file=readfile('mypathto/myfile.html'); $patrn =

RE: [PHP] Regex Lookbehind help

2004-10-26 Thread Michael Sims
Alex Hogan wrote: I just tried this out and the first regex is actually working for me on php 4.3.8 (cli). Can you post some code? At this point all I'm trying to do is print the array with the addresses. $file=readfile('mypathto/myfile.html'); $patrn =

Re: [PHP] Regex Lookbehind help

2004-10-26 Thread Alex Hogan
Check the documentation for preg_match()...it can't be used that way. It returns false or the number of matches, but not the matching text itself. To get the matches you have to supply the third parameter (matches). Plus you'll probably want to use preg_match_all() unless you only want to

[PHP] Regex help...

2004-10-16 Thread Murray @ PlanetThoughtful
Hi All, I rather badly need some help with a regular expression. I need to identify the occurrence of the following search string in another string, and replace it with some text followed by the identified search string. search string pa

RE: [PHP] Regex for Validating URL

2004-09-07 Thread Burhan Khalid
-Original Message- From: Nick Wilson [mailto:[EMAIL PROTECTED] Sent: Thursday, September 02, 2004 11:59 AM Hi all, yeah, i know, i did do quite a bit of searching but I just cant find it... Does anyone have the regex to make sure an http address is full and without error? like

Re: [PHP] Regex for Validating URL

2004-09-07 Thread Wouter van Vliet
On Tue, 7 Sep 2004 10:58:48 +0300, Burhan Khalid [EMAIL PROTECTED] wrote: -Original Message- From: Nick Wilson [mailto:[EMAIL PROTECTED] Sent: Thursday, September 02, 2004 11:59 AM Hi all, yeah, i know, i did do quite a bit of searching but I just cant find it... Does anyone have

Re: [PHP] Regex for Validating URL

2004-09-06 Thread Stut
I know this is an old thread but I've been away for the weekend and I really want to say this... On Thu, 2 Sep 2004 20:40:45 +0200, Nick Wilson [EMAIL PROTECTED] wrote: You know guys? I think you all take this a bit too seriously, perdanticness (is there such a word?) is all well and good for

Re: [PHP] Regex for Validating URL

2004-09-03 Thread Nick Wilson
* and then Jim Grill declared Guys, while we may be able to debate what is rude, what is blunt, what should have been said, what was said, the facts are clear. He apologized, and I think its time to lest this debate rest for now. While I would admit that harshness runs rampid on

<    1   2   3   4   5   6   7   8   >