I have a string of characters "PME". I only want the string to be valid if it matches PME exactly (in that order) and must be exactly three letters long (case insensitive). In short, only the string PME will work, no variations, and no shorter.
I have this so far:
This will ensure that PME is in the correct sequence, but something like PM works also which I can't have. I tried: - [p(?=m(?=e))P(?=M(?=E))]{1}
However that doesn't seem to work.
5 1105
If you are checking to see if PME is in the string, why not use the following:
That will match "PME", exactly as you have prescribed.
Regards,
Jeff
and for case insensitive matching use the "i" option:
But the string must be ONLY "PME", not just contain "PME" - a.k.a. "blah PME foo" shouldn't match, if I'm understanding correctly.
If so, don't bother with a RegEx: just use the lexical equality operator, eq: - if ($string eq "PME") {
-
# ...
-
}
But the string must be ONLY "PME", not just contain "PME" - a.k.a. "blah PME foo" shouldn't match, if I'm understanding correctly.
If so, don't bother with a RegEx: just use the lexical equality operator, eq: - if ($string eq "PME") {
-
# ...
-
}
You are totally correct. No regexp is required per his original requirements, must be PME and only PME, so using a string operator (eq) instead of a regexp is the ticket.
You are totally correct. No regexp is required per his original requirements, must be PME and only PME, so using a string operator (eq) instead of a regexp is the ticket.
Or, if you are really anal and truly want to use a regex, you could do this:
Maybe its just me, but I like regex's and just had to throw that into the mix.
Regards,
Jeff
Sign in to post your reply or Sign up for a free account.
Similar topics
by: engwar1 |
last post by:
Not sure where to ask this. Please suggest another newsgroup if this
isn't the best place for this question.
I'm new to both vb.net and regex. I need a regular expression that will
validate what...
|
by: aevans1108 |
last post by:
expanding this message to microsoft.public.dotnet.xml
Greetings
Please direct me to the right group if this is an inappropriate place
to post this question. Thanks.
I want to format a...
|
by: Tim Conner |
last post by:
Hi,
Thanks to Peter, Chris and Steven who answered my previous answer about
regex to split a string. Actually, it was as easy as create a regex with the
pattern "/*-+()," and most of my string...
|
by: Du Dang |
last post by:
Text:
=====================
<script1>
***stuff A
</script1>
***more stuff
<script2>
***stuff B
|
by: clintonG |
last post by:
I'm using an .aspx tool I found at but as nice as the interface is I
think I need to consider using others. Some can generate C# I understand.
Your preferences please...
<%= Clinton Gallagher
...
|
by: Chris |
last post by:
How Do I use the following auto-generated code from The Regulator?
'------------------------------------------------------------------------------
' <autogenerated>
' This code was generated...
|
by: Martin Evans |
last post by:
Sorry, yet another REGEX question. I've been struggling with trying to get
a regular expression to do the following example in Python:
Search and replace all instances of "sleeping" with "dead"....
|
by: Extremest |
last post by:
I am using this regex.
static Regex paranthesis = new Regex("(\\d*/\\d*)",
RegexOptions.IgnoreCase);
it should find everything between parenthesis that have some numbers
onyl then a forward...
|
by: Phil Barber |
last post by:
I am using Regex to validate a file name. I have everything I need except I
would like the dot(.) in the filename only to appear once. My question is it
possible to allow one instance of character...
|
by: |
last post by:
Hi all,
Sorry for the lengthy post but as I learned I should post
concise-and-complete code.
So the code belows shows that the execution of ValidateAddress consumes a
lot of time. In the test...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |