Topics
-
-
- Leaders
- 2 replies
- 25.1k views
Hi. I'm trying to scrape usernames from http://www.planetminecraft.com/members/any-subject/?mmorder=order_latest I set it to show the number of users that it scraped, which it shows the correct number, but instead of printing the usernames to the ListBox, it simply makes a whole bunch of blank lines. What could be the problem?
Last reply by pry, -
-
- 0 replies
- 7.7k views
Hello, I'm trying to match a regexp with table tags in an html. There are three tables in my page and I want to match each of them seperately. I'm using the followings regexp. This matches from the first tables table tag to the last tables closing tag. How can I make it to match seperately with all three. Html file looks like below Thanks
Last reply by enginaar, -
-
- Leaders
- 2 replies
- 6.5k views
Hi all, I want to enhance this regular expression - ^[0-9a-zA-Z]{6,20}$ to not allow any spaces (leading, in between, and trailing). I know the regexp for space is (\s*), but just don't know how to put them together. Can any one help? Regards, Kyle
Last reply by microkarl, -
-
- 0 replies
- 2.5k views
Good morning all, We have a procedure that requires us to validate all input for text fields; if the input contains certain characters or key words, we must force the user to re-enter alternative data. Some of the characters that we look for at the start of sentances are: ' ; / > -- < admin @ declare = Some of the characters that we look for at the end of sentances are: one > The keywords that we look for are: @@ xss __ (double underscore) NULL varchar ‘’ (double single quote) ascii '; cursor exec (followed by space) -- char( src I have added the regular expression validator to my web page and have entered the following custom v…
Last reply by mike55, -
- 7 replies
- 10.6k views
I have some relative URL's like the followings: <a href="/some/folder/index.html">Sports</a> <a href="some2/folder2/default.htm">Weather</a> What I want to do: <a href="http://www.domain.com/some/folder/index.html">Sports</a> <a href="http://www.domain.com/some2/folder2/default.htm">Weather</a> Basically, I want to insert the domain name at some index. I can match the regular expression without any problem and I did not want to use the groupping in regular expression, because then I have to use a while loop. So I wanted to use the regular expression replace function to enter the domain name in C#. This is …
Last reply by emnoiinay9, -
- 0 replies
- 3.3k views
Hi, I need some help with a regular expression. I have a CSV file with a column that holds the Contact Person Name & Tellephone Number (in one Column). I need to split these into two seperate values. The Field String can be in 2 formats ex: "ContactPersonName (000) 123 4567" or "ContactPersonName 0001234567". Can someone please help me with a Regex to split this string into 2? it should split on the first occurance of "(" or the first occurange of a number. Thanks
Last reply by FaNIX, -
- 9 replies
- 4.8k views
Hey Guys, I have been having a few problems trying to get all the letters in a textbox to split. I want to get any letters that the user types in a textbox to be split into each different letter. The end result will be that i can check each letter and cross reference it with a number. E.G. r returns 32, e returns 54 This is going to be done for every letter that the user types, Any help would be great appreciated! Thanks.
Last reply by Maninder Kaur, -
- 1 reply
- 6.4k views
Hey guys, having some trouble getting a exclude regex function to work. tried to search as much as i can, and have seen that regex isn't ideal for HTML, however i'm hoping to get around this by using exclude function. i want to get the most child html rows, and was hoping to use something like this: <tr.*(?!<tr).*</tr> my thinking for this is that it will catch any <tr> ... </tr>, without </tr> in the middle, being the most child row. However, i can't get it working, can anyone help please. it can be tested on the following, <tr> 1 <tr> 2 </tr> 3 </tr> i would hope to have '<tr> 2 </tr&g…
Last reply by MrPaul, -
- 2 replies
- 3.8k views
I am trying to find a way to correctly use Regular Expression (RegEx) to decompose a specific formatted string into 3 values, here are 3 samples of the strings in question. "1 CASH 1.00 $ 0.21 $" "1 CASH 1.50 $ 0.22 $" "1 CASH 10.50 $ 100.50 $" .. etc .. This format will never change, my goal is to be able to automatically decompose each string into 3 main fields which represent 1=Type (Cash), 2=Value (1.00), 3=Value (0.21). So far I was able to generate the following regular expression: ^[0-9]+[ ]+(.+)[ ]+[0-9]+\.[0-9]{2}[ ]+\$[ ]+([0-9]+\.[0-9]{2})[ ]+\$ This splits/decomposes my string into "CASH…
Last reply by Borix, -
-
- Administrators
- 1 reply
- 8.8k views
Hi, I have this match collection: Dim MC As MatchCollection = Regex.Matches(y, "x") Now I want to split the match collection to an string array! I know I can use MC.CopyTo(MyArray, ?) But the question mark is that I don't know where is the last used index so I can start from next one? How can I do this? Thanks:)
Last reply by PlausiblyDamp, -
-
-
- Administrators
- 1 reply
- 3.7k views
Hi, I want to extract all IP addresses using Regular Expressions: - Dim MC As MatchCollection = Regex.Matches(ReadText, "([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9])") - A valid IP address will be in format: xxx.xxx.xxx.xxx Each xxx can be from 0 to 255, so it can be from 1 to 3 characters. I think the above code should be OK. Just there is a problem that it will accept numbers like 6.2600.5.1 which is invalid. I know that to force it to accept only 1~3 char numbers I should use {1,3}, yes? But I don't know where to place the {1,3}? Please help me. Thank you.
Last reply by PlausiblyDamp, -
-
- 1 reply
- 3.4k views
I am using a regular expression validator to try and validate that the user submits a valid time i.e. nothing over 59 minutes is allowed. I am using the following expression: (\b[0-9]{0,2}\b)?((\.\b[0-5]{0,1}[0-9]{0,1}\b)?) However, the expression is failing to catch numbers over .59 Any suggestions? Mike55.
Last reply by mike55, -
-
- *Gurus*
- Administrators
- 10 replies
- 12k views
Post you favourite resources for regular expressions or any expressions you find useful here. to start the ball rolling http://www.regexlib.com ps. Please try to keep posts on topic, if you have a question or problem with a particular expression request help in a new thread to stop the value of this one becoming too diluted.
Last reply by mskeel, -
-
- 2 replies
- 4.6k views
I need to validate the first two characters of a mobile phone number. I know that the length of the number is 10 characters, and that the first two will be 0 and 8. The third character can be either 5, 6, 7, or 8. I have been going through various tutorials, but I am hitting a brick wall. Mike55.
Last reply by techmanbd, -
- 1 reply
- 2.7k views
Hi, If I have the following strings Vauxhall Corsa 1.2 XS 5 Door 1.4 Citroen Saxo Red Ford Escort Si 1.6i I need to pass them to a function and get the engine sizes out. So for these examples 1.2 1.4 1.6 All the engine sizes will be in the same format number - full stop/period -number. I'm guessing regex might do it but never used before. Thanks
Last reply by mskeel, -
- 2 replies
- 2.8k views
I have code that performs an html scrape: Dim myConnection As New SqlConnection("server=(local);database=xxxx;Trusted_Connection=yes") Dim strAddress As String = ("http:" & straddress & ".html") Dim oRequest As WebRequest = WebRequest.Create(strAddress) Dim oResponse As WebResponse = oRequest.GetResponse() Dim oStream As Stream = oResponse.GetResponseStream() Dim oStreamReader As New StreamReader(oStream, Encoding.UTF8) Dim strData As String = oStreamReader.ReadToEnd() Dim regGames As New Regex("[regexpattern]", RegexOptions.Singleline) Dim mGames As Match = regG…
Last reply by MrPaul, -
- 2 replies
- 3k views
Hi Using this REP I wanna extract all emails from a text: /[A-Z0-9._-]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\.[A-Z.]{2,6}/i And this is a sample text: Dave�s email address dave@mysite.com, Mike�s email address mike@example.com, and Henry�s email address henry@sample.org It's my first time I am using Regular Expressions! so I used and customized this code found in MSDN: Dim text As String = "Dave�s email address [email]dave@mysite.com[/email], Mike�s email address [email]mike@example.com[/email], and Henry�s email address [email]henry@sample.org[/email]" Dim pat As String = "/[A-Z0-9._-]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\.[A-Z.]{2,6}/i" ' Co…
Last reply by ADO DOT NET, -
-
- Administrators
- 10 replies
- 5.5k views
Hi all. Can anyone suggest a way to find specific text in HTML document without confusing it with any HTML tags and their attributes? For instance if I want to find the word body then I can skip the <body> tag. Any help would be appreciated. I've done some reading but I can only find methods to strip HTML tag which in my case stripping HTML tag is out of question. I have to preserve the original HTML document.
Last reply by amir100, -
-
- 1 reply
- 3k views
PS: ignore all quotes, just there to wrap up the regex, also this forum trims spaces so I've said 4 spaces instead of typing them. Does VS2005's search & replace lack full RegEx support (ala .Net's)? I'm trying to safely convert the 4 space indents to tabs, and want to do this safely. Meaning I don't want to simply convert "4 spaces" to "\t" just in case some string or other (non indenting) spacing exists. I tried the following RegExs and VS2005 didn't like them, what am I doing wrong? ^( ){1,} ^(\s{4}){1,}Anybody reading this should read those as 4 spaces, in sets of 1 or more that start at the beginning of the line. The only thing I can get to work in …
Last reply by travisowens, -
- 1 reply
- 2.7k views
First time with regular expressions, I want to match strings that contain .com OR .co.uk OR .info How do I go about that? Thanks
Last reply by IngisKahn,
-
Who's Online 0 Members, 0 Anonymous, 3 Guests (See full list)
- There are no registered users currently online