Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Regular Expression (newbie)

 
   Database Help (Home) -> PHP RSS
Next:  Adding and Deleting records simultaneously in mul..  
Author Message
Cristisor

External


Since: Sep 29, 2008
Posts: 4



(Msg. 1) Posted: Sun Oct 05, 2008 7:58 am
Post subject: Regular Expression (newbie)
Archived from groups: comp>lang>php (more info?)

Hi. I'm not good at all with regular expressions, so maybe someone can
help me with this: I need to create a regular expression that accepts
everything except the word upload. The regular expression for
everything is this: [a-zA-Z_0-9]+, but how can I solve the second part
of my problem? Thank you!

 >> Stay informed about: Regular Expression (newbie) 
Back to top
Login to vote
Michael Fesser

External


Since: Dec 17, 2007
Posts: 867



(Msg. 2) Posted: Sun Oct 05, 2008 1:25 pm
Post subject: Re: Regular Expression (newbie) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

..oO(Cristisor)

>Hi. I'm not good at all with regular expressions, so maybe someone can
>help me with this: I need to create a regular expression that accepts
>everything except the word upload. The regular expression for
>everything is this: [a-zA-Z_0-9]+, but how can I solve the second part
>of my problem? Thank you!

You don't need a regex here. Simply use strpos() to check for the word
"upload".

Micha

 >> Stay informed about: Regular Expression (newbie) 
Back to top
Login to vote
Cristisor

External


Since: Sep 29, 2008
Posts: 4



(Msg. 3) Posted: Sun Oct 05, 2008 11:47 pm
Post subject: Re: Regular Expression (newbie) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Oct 5, 7:59 pm, Michael Fesser <neti... DeleteThis @gmx.de> wrote:
> .oO(Cristisor)
>
> >Hi. I'm not good at all with regular expressions, so maybe someone can
> >help me with this: I need to create a regular expression that accepts
> >everything except the word upload. The regular expression for
> >everything is this: [a-zA-Z_0-9]+, but how can I solve the second part
> >of my problem? Thank you!
>
> You don't need a regex here. Simply use strpos() to check for the word
> "upload".
>
> Micha

my problem is that I have e regular expression in a .yml file and I'm
using it for some kind of validation, to know when to include or not
something. so I don't think I can use strpos() in this file, right?
thanks for the help Micha
 >> Stay informed about: Regular Expression (newbie) 
Back to top
Login to vote
Curtis

External


Since: Aug 09, 2008
Posts: 46



(Msg. 4) Posted: Wed Oct 08, 2008 4:25 am
Post subject: Re: Regular Expression (newbie) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Cristisor wrote:
> On Oct 5, 7:59 pm, Michael Fesser <neti... RemoveThis @gmx.de> wrote:
>> .oO(Cristisor)
>>
>>> Hi. I'm not good at all with regular expressions, so maybe someone can
>>> help me with this: I need to create a regular expression that accepts
>>> everything except the word upload. The regular expression for
>>> everything is this: [a-zA-Z_0-9]+, but how can I solve the second part
>>> of my problem? Thank you!
>> You don't need a regex here. Simply use strpos() to check for the word
>> "upload".
>>
>> Micha
>
> my problem is that I have e regular expression in a .yml file and I'm
> using it for some kind of validation, to know when to include or not
> something. so I don't think I can use strpos() in this file, right?
> thanks for the help Micha

Can you be more specific about what your overall goal is? Maybe
posting a sample of the yml file, and clearly showing what you're
trying to look at in the file would be more helpful.

You can read the yml file into a PHP string with file_get_contents,
and check for "upload" before including the file. strpos() would work
in the PHP file that does the including.

--
Curtis
 >> Stay informed about: Regular Expression (newbie) 
Back to top
Login to vote
Cristisor

External


Since: Sep 29, 2008
Posts: 4



(Msg. 5) Posted: Thu Oct 09, 2008 2:01 am
Post subject: Re: Regular Expression (newbie) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

This is how the .yml file look like:
dizy_WebApp[A-Za-z_]*:
[a-zA-Z_0-9]+:
- /overlib/overlib_mini.js
- /prototype/prototype.js
.........
browseCommunity|overview:
- /gadget.js

So for everything I include prototype.js and the other file for
overview I include also gadget.js, but there is one situation where I
don't want to include prototype.js because I'm including another
framework and this makes the application crash because they can't work
together. So either I give up including prototype.js everywhere and I
include manually in every file, or I find a regular expression that
doesn't allow me to include prototype when I'm in this module called
uploadImage. Thank you
 >> Stay informed about: Regular Expression (newbie) 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
php regular expression - i have a script wrote in perl which i am looking to convert into php. I have the regular expression $field =~ s/^,//; This is to remove a ',' at the start of a string. Does anyonw know what the equivalent would be in php?? If i use this regualr..

Regular Expressions - How do I change only the first occurence of a token in a string? How do I change only the nth occurence of a token in a string? How do I change the first alpha character after the nth occurence of a token in a string? The answer to these questions..

Regular Expression Q - Say I have an HTML file and want to convert all tags to lowercase, but leave the attributes alone. For instance: <SOME TAG ATTRIBUTE="Text THAT may be Upper"></SOME TAG> Needs to be converted to: <some tag attribute="Tex...

Regular expression - I want to remove everything from a string except for Numbers,Lettters and Hypens. Can't get it working, can anyone help? Thanks,

regular expression - I seem to always have hard time understaing how this regular expression works, especially how on earth do people bring it up as part of computer programming language. Natural language processing seems not enough to explain by the way. Why no eliminate it...
   Database Help (Home) -> PHP All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]