473,796 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RegEx for validate domain values

Hi, have a problem with this regex:

^(?<target>orde r|customer)@(?< action>view|sav e|delete)$

With this options: order@view, order@save, order@delete or customer
work fine, but with the target: order or customer fails.

I need match all domain values (order,customer and so... order@view,
order@save, order@delete, customer@view, ect...)?

thx many.

Luca

Jun 10 '06 #1
4 1782
lu********@gmai l.com wrote:
Hi, have a problem with this regex:

^(?<target>orde r|customer)@(?< action>view|sav e|delete)$

With this options: order@view, order@save, order@delete or customer
work fine, but with the target: order or customer fails.
Try again. That description left me with no clue of what is working and
what is not.
I need match all domain values (order,customer and so... order@view,
order@save, order@delete, customer@view, ect...)?

thx many.

Luca

Jun 10 '06 #2
I need perform this logic:

^(?<target>orde r|customer)$|^( ?<target>order| customer)@(view |save|delete)$

without repeat groups: order,customer. I can write this in more compact
regex.

thx

Göran Andersson ha scritto:
lu********@gmai l.com wrote:
Hi, have a problem with this regex:

^(?<target>orde r|customer)@(?< action>view|sav e|delete)$

With this options: order@view, order@save, order@delete or customer
work fine, but with the target: order or customer fails.


Try again. That description left me with no clue of what is working and
what is not.
I need match all domain values (order,customer and so... order@view,
order@save, order@delete, customer@view, ect...)?

thx many.

Luca


Jun 10 '06 #3
Use "{0,1}" to match a part of the expression zero or one times, or the
short form: "?".

lu********@gmai l.com wrote:
I need perform this logic:

^(?<target>orde r|customer)$|^( ?<target>order| customer)@(view |save|delete)$

without repeat groups: order,customer. I can write this in more compact
regex.

thx

Göran Andersson ha scritto:
lu********@gmai l.com wrote:
Hi, have a problem with this regex:

^(?<target>orde r|customer)@(?< action>view|sav e|delete)$

With this options: order@view, order@save, order@delete or customer
work fine, but with the target: order or customer fails.

Try again. That description left me with no clue of what is working and
what is not.
I need match all domain values (order,customer and so... order@view,
order@save, order@delete, customer@view, ect...)?

thx many.

Luca

Jun 11 '06 #4
thx

this: ^(?<target>orde r|customer)(?<a ction>@(view|sa ve|delete)){0,1 }$

work fine!
Göran Andersson ha scritto:
Use "{0,1}" to match a part of the expression zero or one times, or the
short form: "?".

lu********@gmai l.com wrote:
I need perform this logic:

^(?<target>orde r|customer)$|^( ?<target>order| customer)@(view |save|delete)$

without repeat groups: order,customer. I can write this in more compact
regex.

thx

Göran Andersson ha scritto:
lu********@gmai l.com wrote:
Hi, have a problem with this regex:

^(?<target>orde r|customer)@(?< action>view|sav e|delete)$

With this options: order@view, order@save, order@delete or customer
work fine, but with the target: order or customer fails.
Try again. That description left me with no clue of what is working and
what is not.

I need match all domain values (order,customer and so... order@view,
order@save, order@delete, customer@view, ect...)?

thx many.

Luca


Jun 11 '06 #5

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

Similar topics

2
3429
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 was splitted. I am fascinated to the powerfull use of this RegEx class, so I wonder if it could go a step further. As a question, can regex be used to valid a set of different functions ? Example : Suppose I have to verify the correctness of an...
17
3982
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 http://forta.com/books/0672325667/
4
2799
by: ad | last post by:
I am useing VS2005 to develop wep application. I use a RegularExpress both in RegularExpressionValidator and Regex class to validate a value. The RegularExpress is 20|\-9|\-1|?\d{1} When I enter 33 and validate with RegularExpressionValidator, it fail to pass. But when I validate with regex class : Regex.IsMatch(Sight0L, @"20|\-9|\-1|?\d{1}");
9
30482
by: deko | last post by:
As I understand it, the characters that make up an Internet domain name can consist of only alpha-numeric characters and a hyphen (http://tools.ietf.org/html/rfc3696) So I'm trying to write regex that will provide a basic url format validation: starts with http or https (the only 2 prots I'm interested in), is followed by '://', then ( followed by a '.' appearing 1 or more times), then followed by anything *, and is case-insensitive.
3
2703
by: aspineux | last post by:
My goal is to write a parser for these imaginary string from the SMTP protocol, regarding RFC 821 and 1869. I'm a little flexible with the BNF from these RFC :-) Any comment ? tests= def RN(name, regex): """protect using () and give an optional name to a regex""" if name:
10
1887
by: bullockbefriending bard | last post by:
first, regex part: I am new to regexes and have come up with the following expression: ((1|),(1|)/){5}(1|),(1|) to exactly match strings which look like this: 1,2/3,4/5,6/7,8/9,10/11,12 i.e. 6 comma-delimited pairs of integer numbers separated by the
6
4215
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 but not two or more? example myfile.doc = good My.file.doc = not good if you could give an example of the expression pattern that would most helpful. thanks phil
5
13849
by: shapper | last post by:
Hello, What is the Regex expression to validate a date time format as follows: dd-mm-yyyy hh:mm:ss An example: 20-10-2008 10:32:45
6
1501
by: mohaaron | last post by:
Hello all, I'm not very good with writing regular expressions and need some help with this one. I need to validate an email address which has the full name of the person appended to the beginning of it. Here is an example of what I’m trying to validate. “firstname lastname” <username@domain.com> I need to enforce this format so the web form won’t allow submit
0
10239
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...
1
10190
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,...
0
10019
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
9057
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7555
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
5447
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
5579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4122
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
3
2928
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.