473,666 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"[^0-9a-zA-Z\s]" add roman nos. I to V and ' in it

232 New Member
"[^0-9a-zA-Z\s]" . this is my regular expression pattern to clean user input
i want to add roman nos. I to V and ' in it kindly help me where to put these
Apr 22 '09 #1
1 4035
Frinavale
9,735 Recognized Expert Moderator Expert
Your current regular expression matches anything that is not a number, not a character, and not whitespace.

Consider changing it so that it matches anything that is not a number, not a character unless it's one between I and V, and not whitespace.

Something like:
[^0-9a-hw-z\s]

Regular expressions are as easy as breaking it down into what you want.
You can test your logic on sites like this one.

-Frinny
Apr 22 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
17718
by: Ron Brennan | last post by:
This is from an application and not an Applet. I believe it goes to stdout but when I do a test and write an abitrary string and then do a search of the hard disk for the string, I can't find it. So, I suspect one has to create the file manually before using it. But I'll be damned if I can remember where. Thanks to anyone who'll take a few minutes to let me know.
21
2142
by: Alex Martelli | last post by:
I hesitate a bit to post this, but... on the Italian Python NG, somebody was asking whether there was any way to convert an integer number x into a string which represents it in an arbitrary base N (given a sequence with a len of N that gives the digits to use) as "a single expression". I haven't found a really general way, much less a clear one, but, the best I have so far is...: def number_in_base(x, N, digits, maxlen=99): return...
2
1749
by: Shaun | last post by:
Hello! I can't seem to get paths and variables working together: import os a = 'books' os.chdir( '/test') os.mkdir("/test/"a) the last line does not seem to work. os.mkdir(a) makes the directory
114
7700
by: muldoon | last post by:
Americans consider having a "British accent" a sign of sophistication and high intelligence. Many companies hire salespersons from Britain to represent their products,etc. Question: When the British hear an "American accent," does it sound unsophisticated and dumb? Be blunt. We Americans need to know. Should we try to change the way we speak? Are there certain words that sound particularly goofy? Please help us with your advice on this...
1
3938
by: Sugapablo | last post by:
In the following file below, I want it to return itself as a Rich Text Format file that populates the variables with data from the database. I set up the mime types and the filename accordingly. Now, when I call this page on a Linux system, using the Mozilla browser, it opens a dialog, asks me whether I want to save it or open it, and if I open it, opens it as test.rtf, just like I tell it to in the Content-Disposition header.
4
1298
by: Jack Russell | last post by:
Mabry has a nice control which shows the percentage full in both colour and as a number(i.e. If I set it to 50 and red half the box will be red, the other half white and the number 50 will appear). Unfortunately they have no plans to .net it. Does anyone know of a .net equivalent. I know about the MS progress indicator but I cannot colour control that. Thanks Jack Russell
7
4790
by: | last post by:
Borland dumped all its "Borand C++ Builder" (BCB) customers. So it is our term to dump Borland (not only BCB). As a part of my attempt to dump long-loved BCB I'm trying to investigate how one can implement "__property" in ANSI C++. Would anyone have a solution hot to implement "__property" in ANSI C++ ie. how to make following code compile in non-BCB C++ compiler? class TMyClass {
7
4804
by: Barry | last post by:
Hi all, I've noticed a strange error on my website. When I print a capital letter P with a dot above, using & #7766; it appears correctly, but when I use P& #0775 it doesn't. The following capital letters all work correctly - B C D F G M S T with the diacritical marker &#_0775. Why am I having a problem with P?
1
1843
by: Christopher P. Winter | last post by:
I'm seeing some unexpected behavior with Text-indent, as shown on this page: http://www.chris-winter.com/Digressions/HP_Kayak/My_Kayak.html I set up the following style rules for footnotes: DIV.FootRule { Border-bottom: 1px Solid Gray; Margin-bottom: 2px; Text-align: Left; Width: 20% }
10
5507
by: ahager via DotNetMonster.com | last post by:
I am receiving this messaage in a console application I wrote, I am authenticating, and my network admin swears their is nothing wrong with the smtp server. Any ideas? public void Mail_update() { try { System.Web.Mail.MailMessage TME = new MailMessage(); TME.To = "adam_james98@hotmail.com";
0
8443
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8866
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8639
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4198
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
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 we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.