Re: [PHP] Reg-ex help

2009-02-07 Thread Craige Leeder
Thanks! That's a big help. - Craige Jim Lucas wrote: Craige Leeder wrote: Hey guys, I'm trying to write a regular expression to match a tag for my frameworks template engine. I seem to be having some trouble. The expression should match: {:seg 'segname':} {:seg 'segname' cache:} What

Re: [PHP] Reg-ex help

2009-02-05 Thread Jochem Maas
Craige Leeder schreef: > Hey guys, > > I'm trying to write a regular expression to match a tag for my > frameworks template engine. I seem to be having some trouble. The > expression should match: > > {:seg 'segname':} > {:seg 'segname' cache:} > > What I have is... > > $fSegRegEx = "#\{:seg

Re: [PHP] Reg-ex help

2009-02-04 Thread Jim Lucas
Craige Leeder wrote: Hey guys, I'm trying to write a regular expression to match a tag for my frameworks template engine. I seem to be having some trouble. The expression should match: {:seg 'segname':} {:seg 'segname' cache:} What I have is... $fSegRegEx = "#\{:seg \'[a-z0-9\-\_]{3,}\'(

[PHP] Reg-ex help

2009-02-04 Thread Craige Leeder
Hey guys, I'm trying to write a regular expression to match a tag for my frameworks template engine. I seem to be having some trouble. The expression should match: {:seg 'segname':} {:seg 'segname' cache:} What I have is... $fSegRegEx = "#\{:seg \'[a-z0-9\-\_]{3,}\'( cache)?:\}#i"; Which

Re: [PHP] reg ex help

2005-11-08 Thread Richard Lynch
On Fri, November 4, 2005 12:09 pm, conditional motion wrote: > New to php so please bear with me. I'm trying to parse through a > field that has some information in it, the information is stored with > other information and is delimited in a certain pattern so I figure > using reg ex I can get the

Re: [PHP] reg ex help

2005-11-04 Thread Curt Zirzow
On Fri, 04 Nov 2005 14:09:06 -0500, conditional motion wrote: > Here is what the field content from the database would look like. I have > removed any sensitive data. > > str = "Name;Grill Transom (GT302)^% - > Sort;Find/Replace^% - Calc;2568.09x^% - > Type;;;

Re: [PHP] reg ex help

2005-11-04 Thread Jochem Maas
explode on this first: '^% -' then probably on explode ';' like Jay mentioned. then you can probably massage the really weird stuff into shape somehow, stuff like (wtf :-)): Back Number Font;%Athletic^Athletic ..hth conditional motion wr

Re: [PHP] reg ex help

2005-11-04 Thread Dan McCullough
Whos responsible for putting all that information into one field. LOL On 11/4/05, conditional motion <[EMAIL PROTECTED]> wrote: > The name like "Roch Small Sum" and others dont change, they will be in > there whether there is a value associated with them or not. > > > On 11/4/05, conditional moti

Re: [PHP] reg ex help

2005-11-04 Thread conditional motion
The name like "Roch Small Sum" and others dont change, they will be in there whether there is a value associated with them or not. On 11/4/05, conditional motion <[EMAIL PROTECTED]> wrote: > Here is what the field content from the database would look like. I > have removed any sensitive data. >

Re: [PHP] reg ex help

2005-11-04 Thread conditional motion
Here is what the field content from the database would look like. I have removed any sensitive data. str = "Name;Grill Transom (GT302)^% - Sort;Find/Replace^% - Calc;2568.09x^% - Type;Veck^% - PO Number;^% - Previous Order Number;^%%

RE: [PHP] reg ex help

2005-11-04 Thread Pablo Gosse
[snip] The problem with that is there are about 40 different listings in the one field. Silver Small Corp;X^%\n#\n Gold Medium Corp;RE^%\n#\n Platinum Large Corp;YRE^%\n#\n being three of them so maybe this is a bettter way of listing it ... Silver Small Corp;

RE: [PHP] reg ex help

2005-11-04 Thread Pablo Gosse
[snip] New to php so please bear with me. I'm trying to parse through a field that has some information in it, the information is stored with other information and is delimited in a certain pattern so I figure using reg ex I can get the information I want out of the text. So here is an example.

Re: [PHP] reg ex help

2005-11-04 Thread conditional motion
The problem with that is there are about 40 different listings in the one field. Silver Small Corp;X^%\n#\n Gold Medium Corp;RE^%\n#\n Platinum Large Corp;YRE^%\n#\n being three of them so maybe this is a bettter way of listing it ... Silver Small Corp;X^%

RE: [PHP] reg ex help

2005-11-04 Thread Jay Blanchard
[snip] New to php so please bear with me. I'm trying to parse through a field that has some information in it, the information is stored with other information and is delimited in a certain pattern so I figure using reg ex I can get the information I want out of the text. So here is an example.

[PHP] reg ex help

2005-11-04 Thread conditional motion
New to php so please bear with me. I'm trying to parse through a field that has some information in it, the information is stored with other information and is delimited in a certain pattern so I figure using reg ex I can get the information I want out of the text. So here is an example. Silver

RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output

2001-12-06 Thread Jack Dempsey
Sent: Thursday, December 06, 2001 5:13 PM To: Jack Dempsey; PHP list Subject: RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output OK, this time the \n worked. The only thing I changed was using / delimiters instead of | delimiters in the search string. No idea if/why that would a

RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output

2001-12-06 Thread Ken
OK, this time the \n worked. The only thing I changed was using / delimiters instead of | delimiters in the search string. No idea if/why that would affect anything in the replacement string. Anyway, I finally came up with exactly what I wanted: preg_replace(array("/\s*\n+\s*/", "/[ ]+/"), ar

RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output

2001-12-06 Thread Jack Dempsey
] Sent: Thursday, December 06, 2001 1:56 PM To: Jack Dempsey Subject: RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output At 11:41 AM 12/6/01 -0500, Jack Dempsey wrote: >using "\n" as your replacement text will do ithowever, if you want a >newline in the html, then

RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output

2001-12-06 Thread Jack Dempsey
gular expressions as well.its worth the money jack -Original Message- From: Ken [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 3:08 AM To: Jack Dempsey; liljim; PHP list Subject: RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output At 02:43 PM 12

RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output

2001-12-06 Thread Ken
At 02:43 PM 12/5/01 -0500, Jack Dempsey wrote: >$t = preg_replace('/\s+/',' ',$text); One more thing: How do I replace with newline instead of a space? I read through the manuals but couldn't grasp how to do this. \n didn't cut it. And, more advanced - The above replaces any groups of 2 or m

RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output

2001-12-05 Thread Jack Dempsey
sday, December 05, 2001 2:01 PM To: Jack Dempsey Subject: RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output At 10:57 AM 12/5/01 -0500, Jack Dempsey wrote: >a space (\s is from perl) Ah, OK, yours doesn't deal with newlines. From list member "James", a solution

RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output

2001-12-05 Thread Jack Dempsey
t); James "Jack Dempsey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > $text = preg_replace('|\s+|',' ',$text); > > > -----Original Message- > From: Ken [mailto:[EMAIL PROTECTED]] > Sent: Wed

Re: [PHP] Reg ex help-Removing extra blank spaces before HTML output

2001-12-05 Thread liljim
:[EMAIL PROTECTED]... > $text = preg_replace('|\s+|',' ',$text); > > > -Original Message- > From: Ken [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 05, 2001 2:06 AM > To: PHP list > Subject: [PHP] Reg ex help-Removing extra blank spaces b

Re: [PHP] Reg ex help-Removing extra blank spaces before HTMLoutput

2001-12-04 Thread Steve Edberg
One way to do it is: $NewString = ereg_replace('[[:space:]]+', ' ', $String); There are also ways to do it with preg functions that are slightly more efficient; see the pcre docs. And, the standard (AFAIK) reference book for regular expressions is O'Reilly's 'Mastering Regular Express

RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output

2001-12-04 Thread Jack Dempsey
$text = preg_replace('|\s+|',' ',$text); -Original Message- From: Ken [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 2:06 AM To: PHP list Subject: [PHP] Reg ex help-Removing extra blank spaces before HTML output I want to remove all superfluous b

[PHP] Reg ex help-Removing extra blank spaces before HTML output

2001-12-04 Thread Ken
I want to remove all superfluous blank spaces before I sent my HTML output, to make the output smaller. So I'd like to take $input, replace any number of blank space or newlines that are consecutive and replace them with a single blank. I.e. I will list a blank space as b and a newline as n: