473,400 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

Regular Expression (newbie)

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!
Oct 5 '08 #1
4 1911
..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
Oct 5 '08 #2
On Oct 5, 7:59 pm, Michael Fesser <neti...@gmx.dewrote:
.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
Oct 6 '08 #3
Cristisor wrote:
On Oct 5, 7:59 pm, Michael Fesser <neti...@gmx.dewrote:
>.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
Oct 8 '08 #4
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
Oct 9 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
0
by: radawson218 | last post by:
Hi, I'm a complete newbie when using regular expressions, so forgive me if my delimma sounds stupid. I have an ASP.NET app that utilizes url rewriting. It's a simple bookstore that allows...
7
by: Ramprasad A Padmanabhan | last post by:
Hi all, I am a perl programmer and a newbie in C. Can Someone tell me How Can I use regular expressions in C ( on Unix ) . Suppose I am parsing a string like "Ram Prasad" <ram@netcore.co.in>...
6
by: Marc Scheuner [MVP ADSI] | last post by:
Folks, I've started using regular expressions for parsing some data string that come along - works quite nicely, however, as a newbie to RE, I'm still struggling with some special cases: 1) I...
4
by: Buddy | last post by:
Can someone please show me how to create a regular expression to do the following My text is set to MyColumn{1, 100} Test I want a regular expression that sets the text to the following...
1
by: Laser Lu | last post by:
Hi, all, I'm now writing a program to compress JavaScript code. One puzzle is how to write a regular expression to find out and remove all the redundent blank spaces. However, those blank spaces...
7
by: Billa | last post by:
Hi, I am replaceing a big string using different regular expressions (see some example at the end of the message). The problem is whenever I apply a "replace" it makes a new copy of string and I...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
5
by: John Blogger | last post by:
(I don't know if it is the right place. So if I am wrong, please point me the right direction. If this post is read by you masters, I'm honoured. If I am getting a mere response, I'm blessed!) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.