473,509 Members | 2,828 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Searching for a pattern

Hello,

Has somebody a pattern which contains:
- URL Checking (This Syntax: http://www(with and without www).lol.com
- Only *.html, *.htm, *.php formats - also: http://www.lol.com/index.html or
index.htm or index.php.

Thanks.

Gretting!
Jul 17 '05 #1
2 1982
Carved in mystic runes upon the very living rock, the last words of Sven
Dzepina of comp.lang.php make plain:
Has somebody a pattern which contains:
- URL Checking (This Syntax: http://www(with and without www).lol.com
- Only *.html, *.htm, *.php formats - also:
http://www.lol.com/index.html or index.htm or index.php.


Do you mean something like this:

^http://(www\.)?[A-Za-z0-9-]+\.[A-Za-z0-9-]{2,}/?$

For full, proper URL validation, you'll have to go beyond a single
expression. I suppose it might theoretically possible to do it with just
a single expression, but I think people try to cram too much into
regexes, rather than breaking things down a bit.

It just so happens I recently wrote a URL validation plugin for Phorm.
You're welcome to extract the URLVal function from it and use it.

http://www.phorm.com/plugins.php3

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jul 17 '05 #2
Hello Alan,

Your pattern can not help me. =(
Has somebody another idea?

Gretting.

"Alan Little" <al**@n-o-s-p-a-m-phorm.com> schrieb im Newsbeitrag
news:Xn**************************@216.196.97.132.. .
Carved in mystic runes upon the very living rock, the last words of Sven
Dzepina of comp.lang.php make plain:
Has somebody a pattern which contains:
- URL Checking (This Syntax: http://www(with and without www).lol.com
- Only *.html, *.htm, *.php formats - also:
http://www.lol.com/index.html or index.htm or index.php.


Do you mean something like this:

^http://(www\.)?[A-Za-z0-9-]+\.[A-Za-z0-9-]{2,}/?$

For full, proper URL validation, you'll have to go beyond a single
expression. I suppose it might theoretically possible to do it with just
a single expression, but I think people try to cram too much into
regexes, rather than breaking things down a bit.

It just so happens I recently wrote a URL validation plugin for Phorm.
You're welcome to extract the URLVal function from it and use it.

http://www.phorm.com/plugins.php3

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/

Jul 17 '05 #3

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

Similar topics

3
13656
by: Christopher R. Barry | last post by:
I need to search and replace multiple words in one pass of an input stream or string. For example, given the input: "The quick brown fox jumped over the lazy dog's back" and given the...
41
2757
by: Richard James | last post by:
Are we looking at the scripting world through Python colored glasses? Has Python development been sleeping while the world of scripting languages has passed us Pythonista's by? On Saturday...
1
2719
by: Henry | last post by:
I have a table that stores a list of zip codes using a varchar column type, and I need to perform some string prefix pattern matching search. Let's say that I have the columns: 94000-1235 94001...
1
1240
by: Pacher R. Dragos | last post by:
I have recently developed an application in c witch acts like a system logger for windows 2003 server domain controllers and my problem is that of the size. In a normal day my program produces...
7
2652
by: Brian Mitchell | last post by:
Is there an easy way to pull a date/time stamp from a string? The DateTime stamp is located in different parts of each string and the DateTime stamp could be in different formats (mm/dd/yy or...
3
1295
by: masudtarek | last post by:
Hi, I am new in Python programming. Can anybody give me any idea about how to detect more than one date and time (like 11/11/2005 , 10-12-2006, 12:30 etc) from a text file and keep them in a list.
4
2976
by: Costa | last post by:
I am looking for a c/c++ text search engine library that supports: - free text searching - not only beginning of words but substrings as well - wildcard searching - I want strings such as...
3
7325
by: db2admin | last post by:
Hello all, I have table with CLOB column length of ~65K. application is searching from this table by CLOB and i can not create index on it. I know IBM recommends using DB2 Net Search Extender...
2
1501
by: Bart Kastermans | last post by:
I have a file in which I am searching for the letter "i" (actually a bit more general than that, arbitrary regular expressions could occur) as long as it does not occur inside an expression that...
0
7237
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
7347
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7506
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
5656
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,...
1
5062
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...
0
3218
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
443
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.