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
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
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,}\'(
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
Greetings, "Diogo Neves".
In reply to Your message dated Friday, October 31, 2008, 20:08:25,
> It depends on what he really want, but pathinfo really is a better option
> My test worked perfectly on files with no extension and without name...
File always have name. Extension is a part of it.
>
Greetings, "Boyd, Todd M.".
In reply to Your message dated Friday, October 31, 2008, 17:51:59,
> Someone suggested pathinfo() already... and brought up the issues of
> extensions < 3 chars and files with no "basename" (i.e., ".htaccess")...
> Checked out www.php.net/pathinfo, and ran a demo on my
On Fri, 2008-10-31 at 15:03 +0100, Jochem Maas wrote:
> Eric Butera schreef:
> > On Fri, Oct 31, 2008 at 9:09 AM, Warren Windvogel
> > <[EMAIL PROTECTED]> wrote:
> >> Eric Butera wrote:
> >>> Who says every file will have an extension? Who says they're all .+3
> >>> chars? When I first started ph
Eric Butera wrote:
...or you could just use pathinfo and be done with it. I work for
clients. Clients shouldn't have to read a faq to upload a file.
I agree. I assumed that pathinfo simply returned the relative or
absolute path of the file. After further inspection I have to stand
corrected
Hi all,
It depends on what he really want, but pathinfo really is a better option
My test worked perfectly on files with no extension and without name...
On Fri, Oct 31, 2008 at 2:57 PM, Daniel P. Brown
<[EMAIL PROTECTED]>wrote:
> On Fri, Oct 31, 2008 at 9:53 AM, Kyle Terry <[EMAIL PROTECTED]
On Fri, Oct 31, 2008 at 9:53 AM, Kyle Terry <[EMAIL PROTECTED]> wrote:
> Thanks for the reply. For now I used substr($filename,0,-4) and that worked
> perfectly. I need to learn reg ex badly :(.
Before you do that, learn to read and follow along in an email
thread that you start. We gave you
]
> > Sent: Friday, October 31, 2008 7:28 AM
> > To: PHP General Mailing List
> > Subject: [PHP] Reg Ex
> >
> > I'm horrible with regular expression. I need to match the text before
> a
> > file
> > extension. So if the file is called US.123.kyle.2
> -Original Message-
> From: Kyle Terry [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 31, 2008 7:28 AM
> To: PHP General Mailing List
> Subject: [PHP] Reg Ex
>
> I'm horrible with regular expression. I need to match the text before
a
> file
> extension.
On Fri, Oct 31, 2008 at 10:03 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Eric Butera schreef:
>> On Fri, Oct 31, 2008 at 9:09 AM, Warren Windvogel
>> <[EMAIL PROTECTED]> wrote:
>>> Eric Butera wrote:
Who says every file will have an extension? Who says they're all .+3
chars? When I fi
Eric Butera schreef:
> On Fri, Oct 31, 2008 at 9:09 AM, Warren Windvogel
> <[EMAIL PROTECTED]> wrote:
>> Eric Butera wrote:
>>> Who says every file will have an extension? Who says they're all .+3
>>> chars? When I first started php I tried that and it failed in a lot
>>> of places.
>> I've also
On Fri, Oct 31, 2008 at 7:44 AM, Eric Butera <[EMAIL PROTECTED]> wrote:
>
> Who says every file will have an extension? Who says they're all .+3
> chars? When I first started php I tried that and it failed in a lot
> of places.
.htaccess is a prime example of this.
--
http://www.parasane.
On Fri, Oct 31, 2008 at 9:09 AM, Warren Windvogel
<[EMAIL PROTECTED]> wrote:
> Eric Butera wrote:
>>
>> Who says every file will have an extension? Who says they're all .+3
>> chars? When I first started php I tried that and it failed in a lot
>> of places.
>
> I've also run into that problem in
Eric Butera wrote:
Who says every file will have an extension? Who says they're all .+3
chars? When I first started php I tried that and it failed in a lot
of places.
I've also run into that problem in the past. The way that I could work
around all these issues was to document naming convent
On Fri, Oct 31, 2008 at 8:41 AM, Kyle Terry <[EMAIL PROTECTED]> wrote:
> I thought of a couple other ways anyway...
>
> basename($file, '.zip')
> substr($file, 0, -4)
>
> On Fri, Oct 31, 2008 at 5:33 AM, Stut <[EMAIL PROTECTED]> wrote:
>
>> On 31 Oct 2008, at 12:27, Kyle Terry wrote:
>>
>>> I'm hor
I thought of a couple other ways anyway...
basename($file, '.zip')
substr($file, 0, -4)
On Fri, Oct 31, 2008 at 5:33 AM, Stut <[EMAIL PROTECTED]> wrote:
> On 31 Oct 2008, at 12:27, Kyle Terry wrote:
>
>> I'm horrible with regular expression. I need to match the text before a
>> file
>> extension
On 31 Oct 2008, at 12:27, Kyle Terry wrote:
I'm horrible with regular expression. I need to match the text
before a file
extension. So if the file is called US.123.kyle.20081029.zip, I
would then
need to match US.123.kyle.20081029.
No regex required. Why do people think everything like this
I'm horrible with regular expression. I need to match the text before a file
extension. So if the file is called US.123.kyle.20081029.zip, I would then
need to match US.123.kyle.20081029.
Thanks!
--
Kyle Terry | www.kyleterry.com
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
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;;;
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
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
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.
>
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;^%%
[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;
[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.
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^%
[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.
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
- Original Message -
From: "Ford, Mike [LSS]" <[EMAIL PROTECTED]>
To: "'Kevin Stone'" <[EMAIL PROTECTED]>; "PHP-General"
<[EMAIL PROTECTED]>
Sent: Tuesday, July 01, 2003 12:19 PM
Subject: RE: [PHP] Reg Ex to search for both In
> -Original Message-
> From: Kevin Stone [mailto:[EMAIL PROTECTED]
> Sent: 01 July 2003 18:07
>
> $string = "Mark's average score was 544.";
> preg_match("/average score was ([0-9]+)/", $string, $matches);
> $score = $matches(1);
>
> $string = "Julie's average score was 10,443.";
> preg_m
On Wednesday 02 July 2003 01:07, Kevin Stone wrote:
You have started a new thread by taking an existing posting and replying to
it while you changed the subject.
That is bad, because it breaks threading. Whenever you reply to a message,
your mail client generates a "References:" header that tells
I'm a little confused by something. I need to build a reg-ex to scrape for
both plain integers and comma spaced integers in the same place in the same
string at the same time. For example..
$string = "Mark's average score was 544.";
preg_match("/average score was ([0-9]+)/", $string, $matches);
I'm new to using regular expressions so i'm struggling a bit in making an
expression to replace or with \n
$string = preg_replace( "/(|)/i" , "\n",$string);
which needless to say doesn't work. I'm sure its obvious, just need a bit of
a pointer!
Cheers
Tom
--
PHP General Mailing List (http:
On Monday 29 April 2002 15:22, John Fishworld wrote:
> I'm trying to find files in my array
> for example
> ="lg_imode.gif"
> and
> ="/db/imodeklein/edgar-IMODE-1-.gif"
>
> I want to differentiate between the files with slash at the front and ones
> without so that
> I can add a server path !
> bu
I'm trying to find files in my array
for example
="lg_imode.gif"
and
="/db/imodeklein/edgar-IMODE-1-.gif"
I want to differentiate between the files with slash at the front and ones
without so that
I can add a server path !
but as usual I' m having problems with the correct regex
At the moment I'
Sure :)
-Ursprüngliche Nachricht-
Von: John Fishworld [mailto:[EMAIL PROTECTED]]
Gesendet: Samstag, 27. April 2002 1:46 PM
An: Red Wingate; [EMAIL PROTECTED]
Betreff: Re: [PHP] reg-ex please
Excellent :-)))
Thanks !
Can I trouble you again with one more !
I get an url http
ks ! :-))
> Woops , one to many whitespace :)
>
> -->
> Try it like this :
> $code[$i] = ereg_replace("&#([0-9]{5});" , "\\1.bing" , $code[$i] );
>
>
>
> -Ursprüngliche Nachricht-
> Von: Red Wingate [mailto:[EMAIL PROTECTED]]
> Ges
ROTECTED]
Betreff: AW: [PHP] reg-ex please
Try it like this :
$code[$i] = ereg_replace("&#([0-9] {5});" , "\\1.bing" ,
$code[$i] );
-Ursprüngliche Nachricht-
Von: John Fishworld [mailto:[EMAIL PROTECTED]]
Gesendet: Samstag, 27. April 2002 1:11 PM
An: [
Try it like this :
$code[$i] = ereg_replace("&#([0-9] {5});" , "\\1.bing" , $code[$i] );
-Ursprüngliche Nachricht-
Von: John Fishworld [mailto:[EMAIL PROTECTED]]
Gesendet: Samstag, 27. April 2002 1:11 PM
An: [EMAIL PROTECTED]
Betreff: [PHP] reg-ex please
Help please from one of the reg-ex experts out there please !
I'm trying to find the pattern (5 number);
example 𑃸
This works
$code[$i] = ereg_replace("([0-9])+" , "replace\\0.bing" , $code[$i] );
and I get back replace 𑃸.bing
but I also want to lose the and the ;
so I get back 69880.bi
"^[ A-Za-z---]*$"
On Mon, 25 Mar 2002, John Fishworld wrote:
> How can I change this to accept spaces as well ?
>
> (ereg("^[A-Za-zÀ-ÖØ-öø-ÿ]*$", $str))
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing Li
How can I change this to accept spaces as well ?
(ereg("^[A-Za-zÀ-ÖØ-öø-ÿ]*$", $str))
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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
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
]
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
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
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
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
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
:[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
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
$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
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:
On Thursday 08 February 2001 07:40, Michael Dearman wrote:
> > > And the | is using '\d' and 'prem'. It probably should be
> > > "/(div\d)|prem/ Unless those parens are part of the expression.
> > > Then
>
> And after a second look, yea the \d is tightly bound to the div.
> But in confirming this,
Christian Reiniger wrote:
>
> On Wednesday 07 February 2001 21:50, Michael Dearman wrote:
> > > }
> > > elseif( preg_match( "/^\d+$/", $arg[$i], $matches ) )
> >
> > Isn't this \d+ matching --^
> >
> > > {
> > > $value = $matches[0];
> > >
On Wednesday 07 February 2001 21:50, Michael Dearman wrote:
> > }
> > elseif( preg_match( "/^\d+$/", $arg[$i], $matches ) )
>
> Isn't this \d+ matching --^
>
> > {
> > $value = $matches[0];
> > }
> > elseif( preg_match( "/(div\d|prem)
> }
> elseif( preg_match( "/^\d+$/", $arg[$i], $matches ) )
Isn't this \d+ matching --^
> {
> $value = $matches[0];
> }
> elseif( preg_match( "/(div\d|prem)/", $arg[$i], $matches ) )
the \d in this-^^
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
(Lee Stretton) wrote:
> elseif( preg_match( "/^[a-zA-Z]+$/", $arg[$i], $matches ) )
> elseif( preg_match( "/(div\d|prem)/", $arg[$i], $matches ) )
> The first 3 work fine, but the last one "/(div\d|prem)/" doesnt work
> proper
Hi,
I am using regular expressions in a php program to decide what should be
done next. I am having a problem with one of my regex's. The following
is the code i am using:
for( $i = 0; $i < sizeof( $arg ); $i++ )
{
if( $arg[$i] == '' )
{
continue;
}
63 matches
Mail list logo