Re: [PHP] Regular Expression help need

2008-07-27 Thread James Dempster
On Fri, Jul 25, 2008 at 1:08 PM, Shelley <[EMAIL PROTECTED]> wrote: > Hi Richard, > > Not exactly actually. > > What I mean is: > Before: hi Richard>, & good morning< > After: hi Richard>, & good morning< > > I hope it's clear now. > > On Fri, Jul 25, 2008 at 7:53 PM, Richard Heyes <[EMAIL PROTE

Re: [PHP] Regular Expression help need

2008-07-27 Thread Richard Heyes
> Before: hi Richard>, & good morning< > After: hi Richard>, & good morning< By the sounds of it negative look ahead assertions may be of some help. Or look behind assertions. -- Richard Heyes http://www.phpguru.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: htt

Re: [PHP] Regular Expression help need

2008-07-26 Thread Micah Gersten
Are you talking about looking at blogs in a mobile phone browser or actually downloading the blog into another format? Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Shelley wrote: > Ok, let me tell you what i want to achieve. > I want to transfer users' b

Re: [PHP] Regular Expression help need

2008-07-25 Thread Shelley
Ok, let me tell you what i want to achieve. I want to transfer users' blog onto mobile phone, so I should convert characters such as >, <, & (but not &, or >, or <, etc) into xml compatible ones, >, < &. Maybe there is some problem in my expression? Waiting for your response... On Sat, Jul 26, 2

Re: [PHP] Regular Expression help need

2008-07-25 Thread Micah Gersten
Are you trying to make it xml compatible or XHTML compatible? '&' is not valid HTML or XHTML as it has special meaning. If you want it to adhere to the standard and display correctly, you must use '&' Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Shelley w

Re: [PHP] Regular Expression help need

2008-07-25 Thread Shelley
Hi Richard, Not exactly actually. What I mean is: Before: hi Richard>, & good morning< After: hi Richard>, & good morning< I hope it's clear now. On Fri, Jul 25, 2008 at 7:53 PM, Richard Heyes <[EMAIL PROTECTED]> wrote: > > How can I make a string with & (NOT &, >, < or "), <, > > xml > > co

Re: [PHP] Regular Expression help need

2008-07-25 Thread Richard Heyes
> How can I make a string with & (NOT &, >, < or "), <, > xml > compatible? > What is the expression to use? Not entirely sure what you're after (try posting some before and after snippets), but by the sounds of it you don't need a regular expression - strtr() will work for you. Or str_replace().

[PHP] Regular Expression help need

2008-07-25 Thread Shelley
Hi all, How can I make a string with & (NOT &, >, < or "), <, > xml compatible? What is the expression to use? Thank you very much. -- Regards, Shelley

Re: [PHP] regular expression help!

2007-01-18 Thread Roman Neuhauser
(Haven't received William's email yet => scavenging Jochem's reply.) # [EMAIL PROTECTED] / 2007-01-18 18:01:19 +0100: > William Stokes wrote: > > "Roman Neuhauser" <[EMAIL PROTECTED]> kirjoitti > >> This passes with 5.2: > >> > >> class ImgSrcTest extends Tence_TestCase > >> { > >>private $sr

Re: [PHP] regular expression help!

2007-01-18 Thread Jochem Maas
William Stokes wrote: > Hello Roman, > > Could you specify the functionality of your script a bit please. (How it > works) it's a hint as to how you might use simpleXML to extract the values of a src attribute from the definition of an img tag. > > I forgot to mention that this part: > > ', >

Re: [PHP] regular expression help!

2007-01-18 Thread William Stokes
Hello Roman, Could you specify the functionality of your script a bit please. (How it works) I forgot to mention that this part: ', is not always the same. The image properties can vary. Thanks -Will "Roman Neuhauser" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED] ># [EMAIL PR

Re: [PHP] regular expression help!

2007-01-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-18 12:34:36 +0200: > I need to strip all characters from the following text string exept the > image path... > > " src=\"../../images/new/thumps/4123141112007590373240.jpg\" />"...and then > store the path to DB. Image path lengh can vary so I guess that I need to

[PHP] regular expression help!

2007-01-18 Thread William Stokes
Hello, Can someone here give me a glue how to do the following. I guess I need to use regular expressions here. I have absolutely zero experience with regular expressions. (if there's another way to do this I don't mind. I jus need to get this done somehow :) I need to strip all characters fro

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 som

Re: [PHP] Regular Expression help

2007-01-04 Thread Arpad Ray
Note that $ allows a trailing newline, but \z doesn't. Arpad Stut wrote: Chris Boget wrote: echo 'Is String: [' . ( is_string( 'a1b2c3' ) && preg_match( '/[A-Za-z]+/', 'a1b2c3' )) . ']'; echo 'Is Numeric: [' . ( is_numeric( 'a1b2c3' ) && preg_match( '/[0-9]+/', 'a1b2c3' )) . ']'; echo 'Is St

Re: [PHP] Regular Expression help

2007-01-04 Thread Stut
Chris Boget wrote: echo 'Is String: [' . ( is_string( 'a1b2c3' ) && preg_match( '/[A-Za-z]+/', 'a1b2c3' )) . ']'; echo 'Is Numeric: [' . ( is_numeric( 'a1b2c3' ) && preg_match( '/[0-9]+/', 'a1b2c3' )) . ']'; echo 'Is String: [' . ( is_string( 'abcdef' ) && preg_match( '/[A-Za-z]+/', 'abcdef' )

Re: [PHP] Regular Expression help

2007-01-04 Thread Arpad Ray
Those patterns aren't anchored to the ends of the string, so as long as the string contains one matching character, the succeeds. ^ anchors the pattern to the beginning, \z to the end, so you want: /^[A-Za-z]+\z/ Or test the opposite case to see if it fails: /[^A-Za-z]/ Arpad Chris Boget wrote

[PHP] Regular Expression help

2007-01-04 Thread Chris Boget
echo 'Is String: [' . ( is_string( 'a1b2c3' ) && preg_match( '/[A-Za-z]+/', 'a1b2c3' )) . ']'; echo 'Is Numeric: [' . ( is_numeric( 'a1b2c3' ) && preg_match( '/[0-9]+/', 'a1b2c3' )) . ']'; echo 'Is String: [' . ( is_string( 'abcdef' ) && preg_match( '/[A-Za-z]+/', 'abcdef' )) . ']'; echo 'Is Nu

Re: [PHP] Regular Expression help

2006-01-19 Thread John Nichel
Chris wrote: preg_replace('/(? 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, visit: http://www.php.net/unsub.php

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 character

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 characte

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

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 character

[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

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 "123-456-

[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 "(

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

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

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. > > /* > * ex. 00:AA:11:BB:22

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 e

[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. /* * ex. 00:AA:11:BB:22:CC */ function chk_mac( $mac ) { if( eregi( "^[0-9A

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 Petar Nedyalkov
On Wednesday 29 September 2004 08:46, Ed Lazor wrote: > > 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 Enterpr

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: http://www.php.net/manual/en/r

[PHP] regular expression help

2004-09-28 Thread Ed Lazor
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. Unfortunately, I now have a bunch of scripts that require

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 (). > > > $str = 'This X and this X will not be fixed, but this X > and and hopefully t

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 (). $str = 'This X and this X will not be fixed, but this X and and hopefully this X should be, along with this X also. , but not this X.';

[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 (). -- 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-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 an

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 o

[PHP] Regular expression help

2004-08-24 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 hours

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 o

[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 hand

[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 wher

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: > >... >And the regular expression I've got is > >'/[(.+)/Uis' ...which gets you this (I added the parentheses in the middle so you could also get the stuf

[PHP] Regular Expression Help

2004-04-08 Thread Pablo Gosse
Hi folks. I'm having a little trouble with a regular expression and I'm hoping someone can point out what I'm doing wrong. I want to extract from a large number of html files everything between the following specified comments, including the comments themselves: ... The string I'm testing the e

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 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 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 char

[PHP] Regular expression help?

2004-02-02 Thread Jas
Not sure if anyone knows of a good way to match strings of this type... 00:02:8b:0c:2f:09 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 e

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: http://www.php.

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 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; > % $passwo

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 David T-G
Bogdan -- ...and then Bogdan Stancescu said... % % ...as in... % % Looks good to me. You're too kind; I was going to leave the exercise to the student to complete :-) % % Bogdan HTH & HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTEC

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

2003-11-27 Thread Bogdan Stancescu
...as in... Bogdan David T-G wrote: 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, s

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

[PHP] Regular Expression Help Please

2003-11-27 Thread Shaun
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: http://www.php.net/unsub.php

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

2003-11-27 Thread Shaun
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: http://www.php.net/unsub.php

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 ($va

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 CPT John W. Holmes
From: "Bronislav Klučka" <[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 mat

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 Ben
Thanks Bronislav for your answer but this can't be it as the following test code passes validation: ' . nl2br($val); ?> Anyone has an idea? "Bronislav kluèka" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This condition is true if there is no space, new line or tabulator in $val >

RE: [PHP] Regular expression help

2003-11-25 Thread Bronislav Klučka
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 hav

[PHP] Regular expression help

2003-11-25 Thread Ben
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 the bug. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscrib

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) FirstVariable - Second Variable

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) FirstVariable - Second Variable 2) (newline) ThirdVariable... I tried this code: 1) preg_match("/(\S+) - (\S+)/", $html_page,

[PHP] REGULAR EXPRESSION HELP

2003-07-11 Thread John
Hi, I'm pretty new to regular expressions. Before, I used to write long-winded and buggy segments of code with PHPs string functions to extract text. But I want to learn how to use perl reg-ex as it seems useful to know so I ordered "Mastering Regular Expressions". But it hasn't come yet so I'm as

Re: [PHP] Regular Expression Help in my PHP! Sorry if wrong group

2003-01-15 Thread Jason Lehman
Thanks for the response. I found this web page (http://www.itworld.com/nl/perl/01112001/) right after I submitted my question. It was great for explaining regexp's greediness. 1lt John W. Holmes wrote: I have a script that turns certain words into links. That I am having no problems with, it

Re: [PHP] Regular Expression Help in my PHP! Sorry if wrong group

2003-01-15 Thread 1LT John W. Holmes
> I have a script that turns certain words into links. That I am having > no problems with, it is when I want to turn the links back in to plain > text that I am having the problem. Below are my examples. And I know > my regex is being greedy but I don't know how to stop it from being so > damn

[PHP] Regular Expression Help in my PHP! Sorry if wrong group

2003-01-15 Thread Jason Lehman
I have a script that turns certain words into links. That I am having no problems with, it is when I want to turn the links back in to plain text that I am having the problem. Below are my examples. And I know my regex is being greedy but I don't know how to stop it from being so damn greedy

Re: [PHP] regular expression help

2003-01-07 Thread Khalid El-Kary
why don't you just use str_replace ? I'm a bit useless at regular expressions so i thought i ask. i need to turn all [link url=http://www.site.com] link to site [/link] in a string into html http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ___

Re: [PHP] regular expression help

2003-01-07 Thread Maxim Maletsky
Here is your answer: http://www.phpbuilder.com/columns/ying2718.php3?page=2 -- Maxim Maletsky [EMAIL PROTECTED] "adrian [EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote... : > I'm a bit useless at regular expressions so i thought i ask. > i need to turn all > [link url=http://www.site.com] l

[PHP] regular expression help

2003-01-07 Thread adrian [EMAIL PROTECTED]
I'm a bit useless at regular expressions so i thought i ask. i need to turn all [link url=http://www.site.com] link to site [/link] in a string into html http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Regular expression help converting doc to xml

2002-10-02 Thread Geoff
(For the archives) The RegEx I finally used was this: search: (.*) replace: \1 I tried this in 3 editors: jEdit, eMacs and BBEdit jEdit interpreted the replace expression as literally "\1" eMacs didn't like the parenthesis in the search string In BBEdit it worked like a charm. Not sure why. Pe

RE: [PHP] Regular expression help converting doc to xml (somewhatOT)

2002-09-30 Thread Geoff
On Fri, 2002-09-27 at 16:53, John Holmes wrote: This isn't accurate enough because is not always preceeded by: some text. It is sometimes preceeded by some text or other items. This expression matches fairly well: [a-zA-Z0-9\.,'\-\s]* So it matches up to the : A whole bunch of text

RE: [PHP] Regular expression help converting doc to xml

2002-09-27 Thread John Holmes
> I have a fairly large html document that I need to convert to xml. > The current format is is: > A whole bunch of text >Something else > (There is a new line in there before ) > > Which I need to convert to > A whole bunch of text >Something else $new_text = str_replace("\

[PHP] Regular expression help converting doc to xml

2002-09-27 Thread Geoff
I have a fairly large html document that I need to convert to xml. The current format is is: A whole bunch of text Something else (There is a new line in there before ) Which I need to convert to A whole bunch of text Something else Any ideas?? -- PHP General Mailing

Re: [PHP] Regular Expression Help

2001-12-31 Thread Brian Clark
* John Monfort ([EMAIL PROTECTED]) [Dec 31. 2001 11:30]: > I'm using regular expression to extract all text within the tag. > With a BODY tag like >\\only interested in this line. [...] > echo "$out[0]"; > However, this prints everything following (and including) the ' portion of the BOD

[PHP] Regular Expression Help

2001-12-31 Thread John Monfort
Hello everyone, I'm using regular expression to extract all text within the tag. With a BODY tag like \\only interested in this line. I use eregi("( ) ",$str,$out); \\spaces included, here, for easy reading. echo "$out[0]"; However, this prints everything following (and including) the '

[PHP] regular expression help

2001-09-17 Thread Justin French
hi all, I have some user-supplied text on a content driven site. I am allowing tags inside the main text, BUT I want any links to external sites (not on the chosen domain) to include a ' TARGET="_new" ' element. So, http://www.mydomain.com/mypage.php";>something is fine http://www.yourdoma

RE: [PHP] Regular Expression help

2001-07-02 Thread scott [gts]
try something like this: $emails = array('[EMAIL PROTECTED]', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]'); $doms = array( 'domain1.com'=>1, 'domain2.com'=>1, ); while ( list(,$email) = each($emails) ) { preg_match('/^([_\.0-9a-z-]+)@(([0-9a-z][0-9a-z-

[PHP] Regular Expression help

2001-06-29 Thread Clayton Dukes
Hi everyone, I have a new user function that checks e-mail addresses. I wish to only allow people from two different domains to register. How can I filter out all other e-mail addresses and return an error if it's not from those domains. Here's what I have: if ((!$email) || ($email=="") || (!er

Re: [PHP] Regular Expression Help

2001-05-22 Thread Christian Reiniger
On Tuesday 22 May 2001 19:44, Jason Caldwell wrote: > I'm trying to figure out how to "say" with a Regular Expression how to > check for the following characters in a phone number: > > ( ) - > > with a length between 1 and 20 -- preg_match ('/^[\d()-]{1,20}$/', $Subject) should do the trick. --

Re: [PHP] Regular Expression Help

2001-05-22 Thread Mark Maggelet
On Tue, 22 May 2001 10:44:42 -0700, Jason Caldwell ([EMAIL PROTECTED]) wrote: >I'm trying to figure out how to "say" with a Regular Expression how >to check >for the following characters in a phone number: > >( ) - > >with a length between 1 and 20 -- > >I've tried the following and it doesn't see

[PHP] Regular Expression Help

2001-05-22 Thread Jason Caldwell
I'm trying to figure out how to "say" with a Regular Expression how to check for the following characters in a phone number: ( ) - with a length between 1 and 20 -- I've tried the following and it doesn't seem to work. eregi("^([0-9]|\\(|\\)|\\-){1,20}$") I'm not interested in checking for a

Re: [PHP] Regular Expression Help

2001-03-05 Thread Henrik Hansen
> I want to delete everything after a tab (or space) on each line of > a text file and can't figure it out. > > An example line is > ARIA 5.19 -0.0625 -1.19 5.25 4.5 48.5 100300 > you can explode on a tab $arrlines = explode("\t", $the_line); then save $arrlines[0] from every line. Don't kno

[PHP] Regular Expression Help

2001-03-05 Thread Jeff Oien
I want to delete everything after a tab (or space) on each line of a text file and can't figure it out. An example line is ARIA5.19-0.0625 -1.19 5.254.5 48.5100300 I want to the output to be ARIA Thanks. Jeff Oien -- PHP General Mailing List (http://www.php.net/) To un

Re: [PHP] regular expression help

2001-01-25 Thread Jeff Warrington
In article <005801c08668$e0459070$0201010a@shaggy>, "Jamie Burns" <[EMAIL PROTECTED]> wrote: I tried something like this and your examples worked: $str = ""; if (eregi("=[[:space:]]*\"([^\"]+)|=[[:space:]]*([[:alnum:]]+)",$str,$regs)) { print("yes - ".$regs[1].":".$regs[2]."\n"); } since th

[PHP] regular expression help

2001-01-24 Thread Jamie Burns
can anyone help me figure out a regular expression to find the value of a tag element? for example: so in each of the above i need to find either "my value" or "value"... i tried this but it wont work for every situation: ereg("element[ ]*[=][ ]*[\"