Regex for path and alpha numeric character [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I need regex to validate path like
/addd/dddd
aaaa/bbbb/
a1233/dddd
but not
#ddd/aaaa
or any other symbol,how should I do that?

Try with this one(considering only aaa can not be a path, if so, add it with pipe):
^((?:/[a-zA-Z0-9]+)+/?|/?(?:[a-zA-Z0-9]+/)+)[a-zA-Z0-9]*$
(?:/[a-zA-Z0-9]+)+/? is matching paths like aa/aa/ and /?(?:[a-zA-Z0-9]+/)+ is matching directories like /aa/aa. And [a-zA-Z0-9]* is checking for additional names when the directory format is aa/aa.
Try this regex at online

Related

Parse file with two columns into dictionary using C# [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I am new in C#, and needs to help!
How to parse file like:
0.05;32.302758269034
0.050001;32.3019279599779
to dictionary? What libraries are necessary?
Thancks a lot!
You will need System.IO.File.ReadAllLines, string.Split and Enumerable.ToDictionary.

how to set textbox format ###-###-### using regular expression validator? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
how do i set validation expression using this type of format ###-###-### this is for TIN number(Philippines). if not possible format like 9 numbers and 3 - .
Use this regular expression in RegularExpressionValidator:
\d{3}-\d{3}-\d{3}

Alphanumeric regex expression in c# [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am new in the programming and i am looking for a regular expression as
first three characters should be alphanumeric followed by a constant which is a special character and then 1 or more hashes
(3 alphanumeric) (constant) ( one or more hashes)
AB1-#
ABC$##
etc
you can use something like
(\w{3})([^\s])(#+)

Need Some Suggestion For A Regex [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Hi guys I Need Some Help With A Regex:
I Need A Regex:
1. that accepts all type of characters like ą or Э or Ǿ or Я ...
2. which the number of characters is between 3 and 15
3. doesn't contain special characters
I'm guessing you want to match 3 to 15 Unicode letters. For that, you can use
new Regex(#"^\p{L}{3,15}$")
If you also want to allow spaces, you can use a character class:
new Regex(#"^[\p{L} ]{3,15}$")

How can I get the string between two tags [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I wonder how to get a string (or array of strings) between two known tags.
For example I have this string
string var1="my first video is [video]http://video.com/aaa[/video] and my second is[video id=\"1\" length=\"3\"]http://video.com/bbb[/video]";
How to get these values http://video.com/aaa and http://video.com/bbb?
use this pattern: #"\[video.*?\](.*?)\[/video\]" and then get group 1. I won't post the whole code because I dont want to do your work for you. Read about C# Regexes, Patterns and try to write your code with this pattern.

Categories