473,657 Members | 2,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

limit character occurrences in a regex character set but allow random ordering

1 New Member
Im trying to do a regular expression that only gets letters in a certain character set '^[abcd]+$ but i want to not get words like badd or cabb and only cab or bad so that each character in the character set is only used once or the number of time used in that character set? i dont know if this will be possible because i may have multiple occurences of the same character in one chracter set


Not to complicate this but that is only the first part what i really want to do is also allow one wildcard to occur within that character set but limit it to occurring x number of times while allowing random ordering of the character set still. I tried was going to do a '^[abcd]+.[0,1}$ but the random ordering isnt working at all only on the exteriors of the expression do i find it possible. Does anyone know how to find a solution?
Sep 3 '12 #1
1 2448
zmbd
5,501 Recognized Expert Moderator Expert
Please:
- Show you your work... that is what code have you tried.
- Only one question per thread.
-z
Sep 12 '12 #2

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

Similar topics

0
2012
by: Bill | last post by:
Dear All, I have a question related to character set. The default encoding of MySQL is latin1. So, textual data should be interpreted as 8-bit character. Is that right? If the default character set to , say big5, in server startup, will MySQL interpretes all textual data as 16-bit character?
2
1286
by: Daz | last post by:
Hi everyone. I am looking to create a simple function that will spot a hexcolor in a font tag, that has quotes, and remove the quotes. i.e <font color="ffffff"should become <font color=ffffff>. Perhaps I am making it more complex than it needs to be, but I have broken down the input string into an array of single characters using preg_split(), and I am iterating through the chars, looking for a quote followed by a hash. The problem...
0
232
by: trashman.horlicks | last post by:
Hi all, More regex questions, sadly ;) If I had a string that could contain any combination, or some/none of .+-*/ how could I strip off extraneous characters after any of these characters to get just the left most sub string? eg Do.Bears+Defecate*Rurally would give Do Mostly*Harmless would give Mostly Don-t/Panic
0
952
by: rajap | last post by:
The scenario is, when I do search on google site it throws several links. The Test script has to pick up the hyperlinks randomly. I tried, but unable to define exactly. I gave ‘testing’ as search criteria in google. This has to be done thru VSTS (TeamTest) - .NetC#
5
25518
by: herman | last post by:
How can I replace all occurrences of a character with another character in std string? For example, I want to replace '/' with '+' in my std::string I have looked at the replace() method in the string class, it does not replace all occurrences of a character with another character. http://www.cppreference.com/cppstring/index.html
3
3455
by: alessio211734 | last post by:
How can I check in c++ string if a character is lower or upper? Exist a function in c++ to convert string to upper characters? Thanks in advance.
2
1491
by: George2 | last post by:
Hello everyone, I need to know the wide character (unicode) and multibyte (UTF-8) values of a character string of czech. I personally know nothing about czech. Is the following approach correct? 1. I use L on the character string and watch memory to get the wide character representation of the character string in little endian form; 2. I change the computer region/language to czech, and use function WideCharToMultiByte, and use CP_ACP...
2
1859
by: christopher taylor | last post by:
hello python-list! the other day, i was trying to match unicode character sequences that looked like this: \\uAD0X... my issue, is that the pattern i used was returning:
0
857
by: christopher taylor | last post by:
My apologies to the respondents - I failed to screen my test cases before kicking them out to the global python-list. but yes, the 'X' character in my test case was a mistake on my part. I'll give group() a shot. ct
3
2442
by: Petimus | last post by:
Nowhere can I find the beginning of line Character for Regex in C#. Im using the expression *(, *)*$ But without the <Beginning of line>*(, *)*$ my strings are accepted with random letters in them like "1ThisShouldntBeHere7, 12, 2" because it just starts matching at the 7. Please I need the beginning of line character for regular expressions in C#... its has become the bane of my existance. Thanks, Petimus
0
8392
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
8305
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,...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6163
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
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
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1950
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1607
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.