Tagged Questions
0
votes
0answers
5 views
Regex parsing url() and @imports in CSS C#
I'm new in regex and i'm trying to parse the CSS file, to get the:
@imports "file.css"
url (pathtoFile)
But it fails.
Regex cssUrls = new Regex(@"(url|@import)((?['""])?(?.*?)\k?)", ...
0
votes
4answers
88 views
C# using regex to replace value only after = sign
ok I have a text file that contains:
books_book1 = 1
books_book2 = 2
books_book3 = 3
I would like to retain "books_book1 = "
so far I have:
string text = ...
0
votes
4answers
75 views
Regex doesn't give me expected result
Okay, I give up - time to call upon the regex gurus for some help.
I'm trying to validate CSV file contents, just to see if it looks like the expected valid CSV data. I'm not trying to validate all ...
0
votes
4answers
49 views
regular expression for 2 string arguments having numeric values with range constraint
I need to validate console input arguments. User can pass only 2 arguments separated by Space.
First argument should be between 1 to 100
Second argument should be between 1 to 750.
I need a ...
0
votes
2answers
60 views
Regex contain multiple string
I have many problem for understand regex, i'm not sure what I'm trying to do is possible.
I want a regex able to match with a string that contains "a" AND "b" in any order.
Example :
rrrarrbrr
...
1
vote
4answers
73 views
NET Regex: {1} not working
if (!Regex.IsMatch("1234567-8A","[0123456789]+-[0123456789K]{1}"))
Console.WriteLine("It is not match");
else
Console.WriteLine("It is match");
This outputs "It is match", but shouldn't.
...
-7
votes
1answer
56 views
Need Regex for DateTime in C# [closed]
Explaining the scenario
I have the logs as below.
*044*05/02/2013*14:24*
*1234*1*(Iw(1*0, M-00, R-10011002100310041
A/C
OPERATION OK
*044*05/02/2013*14:24*
*1234*1*(Iw(1*0, M-00, ...
0
votes
3answers
33 views
Regular expression to match Style sheet pattern
I would like to write a regular expression to match the following patters
CSS color words such as blue,black ,etc
Hexa decimal color codes
How to generate a regular expression to match the above ...
1
vote
1answer
41 views
Find match of string in Regex, put into variable, tricky string
I'm very new in this Regex, there's still a lot I don't understand.
I see a lot of @, but I can't find it in MSDN. What's the @ for? eg:
Regex regex = new Regex("@{lalala},", RegexOptions.Compiled);
...
0
votes
2answers
30 views
Extracting image link through regex in C#
I have a bunch of links in this format
http://imgur.com/a/bwBpM
http://imgur.com/a/bwBpM[/IMG]
[IMG]http://imgur.com/a/bwBpM
[IMG]http://imgur.com/a/bwBpM[/IMG]
The IMG tags are only supplied in ...
2
votes
2answers
47 views
Match pattern in regex expression
I'm developing a generic application and I need to match a pattern that I can't solve.
The input string could be:
12_B 99-23_9_23
As you can see in the example, my problem is when I want to match ...
1
vote
1answer
28 views
How do I regex for multiple items within a single string with c#?
My string is the following format:
"[Item1],[Item2],[Item3],..."
I want to be able to get item1, item2, item3, etc.
I am trying the following grep expression:
MatchCollection matches = ...
0
votes
1answer
78 views
Regular expression to get first HTML line
I'm using C# and .NET 4.5.
I have HTML files that I have loaded into memory from a database connection. I would like to extract the first line from them. I think that it should be suitable to do this ...
0
votes
1answer
55 views
Need help modifying a regex that once worked
I am trying to parse a string and build a dictionary that will contain the name of the field and its value as key / value.
Here's the code:
var dictPriceList = Regex.Matches(priceListToParse, ...
7
votes
7answers
282 views
Find all 'more or less than' characters which is not tags in xml
I need a regex to find all '<' or '>' which is not xml-tags.
Example:
<tag1>W<E><E</tag1>Z<>S
Should find
<><<>
Example:
...