Recent update: 2008-3-21
810 byte By
Abunet at 2008-3-7
HI,I've got some strings that contain the following text:1) "That film is very beautifull".2) "How much beautifull is the film?".3) "The film is boring".I need, if it is possible with RegEx, to search if the string contains "film" AND ...
974 byte By
Jae at 2008-3-6
Hi,If I had a textbox that contained the following:--Mr FirstName LastNameABCD Ltd, Address 1, Address 2, Town/City, PostCode,Notes1, Tel: 0171 800900, Fax: 0171 800909--how can I parse this to --Mr, FirstName, LastName, ABCD Ltd, Address 1, Address 2, Town/City, PostCode, Notes1, 0171 800900, ...
4/21/2003 : On 4/21/2003 6:02:49 PM By DBROWN :: ; On 4/21/2003 7:04:41 PM By DBROWN :: called on 4/19 ; from the above string can any one tell me the pattern toextract the date preceded by 'On ' and name preceded by ...
Re: System.Text.RegularExpressions.Regex, C#lets call the string to be searched target stringDesired Result: Efficiently Match a regular expression to target string. WHOLE target string should be consumed.Actual Result: The Match searches as documented until it finds a match WITHIN the target ...
I am using StreamReader's method ReadToEnd() to read an entire file in to a String. I then use a Regex to parse some content from the file. I do this two times for each file to get all the data i want from it. The first regular expression looks like this:String^ regexData1 = ...
I am trying to this regex but I am not. is it possible? help me!!!!string: x*[2+[(2+y)*z]*(4+y)]-3/[(3+y)*z] regex: ? matches: 2+[(2+y)*z]*(4+y) (3+y)*z (Moderator: Thread moved to the Regular Expression Forum and Title tweaked for quicker thread understanding during a search) ...
I am trying to this regex but I am not. is it possible? help me!!!!string: x*[2+[(2+y)*z]*(4+y)]-3/[(3+y)*z] regex: ? matches: 2+[(2+y)*z]*(4+y) (3+y)*z (Moderator: Thread moved to the Regular Expression Forum and Title tweaked for quicker thread understanding during a search) ...
973 byte By
Jil at 2008-2-26
I am using VS 2003 and Regex.I wanted to spilt the text from richtextbox if it matches newlines or semicolon or "/" or "\n\x20*\n" etc few sequences.If any of these matches, I need a splitFor single sequences, I use thisRegex* regxterm = __gc new ...
Hi all,I need to parse a string which is in the following format (example): -0.0004 USD/TonnesBasically, it will be a double value, might be preceded by the negative (-) sign and followed by <Currency>/<Unit of Measure> .The result should be just the double value (with the sign if ...
I'm working off the help here for examples and struggliong to understand how I can convert it's multiline example into a oneliner. I'm more used to Perl ;-).Here's some code fro example that works:string First3(Match M) { return M.Value.Remove(3); } // defined in the class MyClassMyClass C ...
can anyone explain about regular expressionsthe complex patterns that are shown in the previous threads are hard to follow. i need some more explaination how to give a pattern..Thanks in advance..(Moderator: Thread moved to the Regular Expression Forum and Title tweaked for better ...
can anyone explain about regular expressionsthe complex patterns that are shown in the previous threads are hard to follow. i need some more explaination how to give a pattern..Thanks in advance..(Moderator: Thread moved to the Regular Expression Forum and Title tweaked for better ...
465 byte By
NETPR at 2008-2-22
Hello,I will be working with text from files and manipulated them. Thus, I need to learn about RegEx. I know the HELP in visual studio has it and it even has examples, but those examples are not explained....all I see is a bunch of symbols that work together to get their results....They do not ...
I am trying to find the decimal index location from RightToLeft using Regex/Match. When the code below runs, I keep getting the index value from LeftToRight even though I specified RegexOptions.RightToLeft. What am I missing here?Regex r = new ...
308 byte By
neocon at 2008-2-20
i have to generate a string based upon a regular expression provided as input. There is a System.Text.RegularExpressions.Regex class in .net but i could not find any API to generate string using a Regex object. Can any suggest how can i generate a string using regular expression in C#? ...
I'm having a problem understanding how Regex.Match interprets an extremely trivial match problem.If I'm searching the string "ban" with the pattern b*, the matched string is b as one would expect. But if I change the pattern to a*, there is no match.Now I would have thought that since .NET ...
I am looking to split a string at a specific character count and return an array of strings from that, with the smarts ofnot splitting on a word....The functionality would somewhat mirror string.Split which is used to tokenize, but instead of a character it would have a hard minimum line size. ...
974 byte By
renemt at 2008-2-19
Hi there!I'm now trying since hours to construct an appropriate regex that will fit my needs. Here is the starting situation:I've got a string like"abc F123[F456[F789]] 123"In this string I want to find the following expressions:- F123[F456[F789]]- F456[F789]- F789An expression is defined as ...
I need a regex pattern that can be used to extract urls from the clipboard. Clipboard data could be text, html or rtf even.Possibly three different patterns?Any ideas?Anyone done this sort of thing before?There are so many problems of course, for example invalid characters in url, url cant ...
Hi,I have yet another regex query - this time regarding the retieval of a URL from HTML. I have a string called HTML, with a number of links on it. The format for these links is something like:<a href="/index/welcome.php?action=one&section=27">one</a>Now, I only ...
Someone know where hava a example og validation of email. <font face=Verdana>Thank you! </font>
i have a dynamic string, for example "([1] * [5]) / 100"what I want to do is find all the matches of strings hed within the square brackets. for each instance i want to tun some logic and do a replace. e.g. in the above example [1] i would be replacing with [Joe Bloggs] after doing a lookup on ...
i have a dynamic string, for example "([1] * [5]) / 100"what I want to do is find all the matches of strings hed within the square brackets. for each instance i want to tun some logic and do a replace. e.g. in the above example [1] i would be replacing with [Joe Bloggs] after doing a lookup on ...
I need a regex for a timespan .. from 15 min to 24 hour. input is something like 00:15I'm not very good in building the pattern. Thanks, (Moderator: Thread move to Regular Expression forum and Title changed from "Help on regex" to "Regex and Timespan" for quicker thread understanding during a ...
I need a regex for a timespan .. from 15 min to 24 hour. input is something like 00:15I'm not very good in building the pattern. Thanks, (Moderator: Thread move to Regular Expression forum and Title changed from "Help on regex" to "Regex and Timespan" for quicker thread understanding during a ...
I have an issue with RegEx. Here is an example of what I am doing and what I am expecting and what I get.Text:Glenn InmanExpression:(?<!(?i:\bhoward\b))\s+(?i:\bglenn\b).* Code:bool bMatch = RegEx.IsMatch("Glenn Inman", "(?<!(?i:\bhoward\b))\s+(?i:\bglenn\b).*")Returns falseexpect ...
Hi ! Can someone plz help me to extract last number in strings using Regex ? here some examples: 1: "ksdhfkjsdhf 12" 2: "sdfsd fd sdfsdf 333" 3: "jgjhhhjdfg15" the result should be: 12 333 15 Thanks !!!
I have an input file (this is simplified; the real input file is very very very large):A 1\nB 2\nC 3\nD 4\nI am using the following code: Regex first_part = new Regex("[A-Z]* "); Regex second_part = new Regex("[A-Z]*\r\n"); MatchCollection firsts = first_part.Matches(input_file); ...
Hi,I'm trying to split a string that holds the full path to a directory using Regex(i.e Regex *regex = new Regex(S"\\");, however I keep getting the following error : parsing "\" - Illegal at end of patternParameter name: \.Is there any other way to split up the directories, or to fix this ...
Hi,I'm trying to split a string that holds the full path to a directory using Regex(i.e Regex *regex = new Regex(S"\\");, however I keep getting the following error : parsing "\" - Illegal at end of patternParameter name: \.Is there any other way to split up the directories, or to fix this ...
Hi everyone,I'm writing a client for the Cyan Chat protocol ( http://cho.cyan.com/chat) and all of the usernames are sent to the client as:X[username]|^1TextThe X prefixing the username is a colour code. Currently I can print out what users say in my richTextBox, but I need a regular expression ...
713 byte By
GailG at 2008-2-11
I'm trying to do something that ought to be very simple. I'm trying to test whether a string (which is an argument to a command) is a valid value of the type I need.That is, I want it to be convertable to a double and be in the range 0.1-1.0.I have this line in my code:Regex ValidPause = new ...
With ref to Egyptian's code http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=570980&SiteID=1to find paras in a string and split each para and populate datagridview1 col1, row1 with para1... col1, row2 with para2 etc...I am unable to translate this to c# and request help esp with the ...
With ref to Egyptian's code http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=570980&SiteID=1to find paras in a string and split each para and populate datagridview1 col1, row1 with para1... col1, row2 with para2 etc...I am unable to translate this to c# and request help esp with the ...
Hi, could anyone tell me how I could make some changes to make the following code be able to return true when strURL=" http://mm77/creator" please? It's urgent! Thanks in advance!!public static Boolean isURLValid(String strURL){ Boolean blnResultURL = false;if ...
Hello, can someone help me in providing a regular expression who 'se adequter with a string who have a min required length 6 characters . in these caracters 2 , minmum, are none alphanumerical characters thanks
Hello! I want to ask a simple question about regular expression in asp.net.the question is how to handle "javascript" as a single word by creating a validation expression for regular expression server control.Please, I need the answer as soon as ...
Regex regex = new Regex( "^\d+$");this code gives an error pointing \d .error message is "invalid escape character" , but in fact \d is not escap character , \d means 0 to 9 digits.how can i fix this ...
I am having an string "3<2", I would like to use it in a if statement as if(3<2). How to convert this string into an boolean expression. Can we convert a string like "a<b" into a boolean expression.
I'm having a problem understanding how Regex.Match interprets an extremely trivial match problem.If I'm searching the string "ban" with the pattern b*, the matched string is b as one would expect. But if I change the pattern to a*, there is no match.Now I would have thought that since .NET ...
hi all.....i try to mod ify my .ini file using regex function......and this is my code Dim checkpassword As String = Regex.Replace(Regex.Replace(line, "^USER=goh.dev.ss.lan", ""), "Password=", "Password=123") sw.WriteLine(checkpassword) sw.Close()this will replace all the matched ...
hi all.....i try to mod ify my .ini file using regex function......and this is my code Dim checkpassword As String = Regex.Replace(Regex.Replace(line, "^USER=goh.dev.ss.lan", ""), "Password=", "Password=123") sw.WriteLine(checkpassword) sw.Close()this will replace all the matched ...
I need to run verification on SSN's read from a file sent to us by our users. We cannot process any records that with an SSN that has all zeroes, ones, twos, threes, ... etc.I have completed the below RegEx that catches all invalid SSN's up to a point and then began wondering if another way ...
I need to run verification on SSN's read from a file sent to us by our users. We cannot process any records that with an SSN that has all zeroes, ones, twos, threes, ... etc.I have completed the below RegEx that catches all invalid SSN's up to a point and then began wondering if another way ...
Here is the situation, using C# and VS2005, one has a string that contains a number. Unfortunatley the originator of the string is ouputing commas within the string such as"1,234,567.89"What is the best way to strip commas from a string?Below is a method I have come up with that seems ...
406 byte By
KellyB at 2008-2-4
I would just like to post a request. In a future version of the C# language (possibly 3.0) It would be very nice to be able to create a Regex in the ECMAScript style syntax.So instead of:Regex myRx = new Regex("\\d+\\.\\d{2}");We could use:Regex myRx = /\d+\.\d{2}/;Since Regex features are ...
hello,I have an apllication that have about 3000 regexp compiled using the formregexp = new Regex(expression, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);when a try to match a string against the 3000 regexp for the first time it take about 2 minutes on a Big ...
hello, I have an apllication that have about 3000 regexp compiled using the form regexp = new Regex(expression, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); when a try to match a string against the 3000 regexp for the first time it take about 2 minutes on a ...
Hi, I have a HTML file which contains a lot of lines in form <tr><td nowrap="0">First cell text</td><td nowrap="0">Second cell text -</td></tr> and I need to extract text from cells in second column (take note of a dash at the end of ...
Hi, I need to check if a string in a certain format using Regular Expression. I want to check if the string is 23:46 format. where 23 can be any 2-digit integer and 46 can be any 2-digit integer as well..and the two integers are separated by a colon character : How can I write it in a regular ...