473,379 Members | 1,379 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,379 software developers and data experts.

I can not match "&" - regexp

Hi

if ( eregi("^[\&/[:space:]/a-zA-Z0-9±ęćłń󶿼ˇĆĘŁŃÓ¦¬Ż\.\/\/-]{2,65}$","Merry
& Cat") )
return true;
else
return false;

I'd like to match also "&" but this regexp above does not do this, adding \&
does not help. Any ideas?

Thank you

Apr 26 '07 #1
2 1444
no
Papkin wrote:
Hi

if (
eregi("^[\&/[:space:]/a-zA-Z0-9±ęćłń󶿼ˇĆĘŁŃÓ¦¬Ż\.\/\/-]{2,65}$","Merry
& Cat") )
return true;
else
return false;

I'd like to match also "&" but this regexp above does not do this,
adding \& does not help. Any ideas?

Thank you
i see some pretty wild characters there.
give it a try with this

eregi('[a-z]+ \& [a-z]+', 'Merry & Cat')

Apr 26 '07 #2
Rik
no@email.com wrote:
Papkin wrote:
>Hi

if (
eregi("^[\&/[:space:]/a-zA-Z0-9±ęćłń󶿼ˇĆĘŁŃÓ¦¬Ż\.\/\/-]{2,65}$","Merry
& Cat") )
return true;
else
return false;

I'd like to match also "&" but this regexp above does not do this,
adding \& does not help. Any ideas?

Thank you

i see some pretty wild characters there.
give it a try with this

eregi('[a-z]+ \& [a-z]+', 'Merry & Cat')

Or use preg_match:

preg_match('|^[\s&a-z0-9±ęćłń󶿼ˇĆĘŁŃÓ¦¬Ż./\\-]{2,65}$|i',$string);

--
Rik Wasmus

Estimated date being able to walk again: 01-05-2007.
Less then a week, hurray!
Apr 26 '07 #3

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

Similar topics

1
by: David Furey | last post by:
Hi I have an XML documnet and a XSLT document as shown below THe XSLT document brings back a filtered docmument that has the VendorName that starts with a particular sub-string This works as...
6
by: vigi98 | last post by:
Hello all, Can someone confirme that this: var strURLpiece = "UK & Ireland"; strURLpiece.replace("&", "%26"); replaces all occurrence of the character & by %26 in strURLpiece, ie that...
4
by: barney | last post by:
Hello, I' m using .NET System.Xml.XmlDOcument. When I do the following: XmlDocument xml = new XmlDocument(); xml.Load("blah"); .... xml.Save("blub"); I've got the problem that the following...
5
by: martin | last post by:
Hi, I would be extremly grateful for some help on producing an xml fragemt. The fragment that I wish to produce should look like this <Addresses> <Address>&qout;Somebody's Name&quot;...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.