Converting Regex From .NET To C#?
Dec 24, 2011
I hired a coder to code me something in Regex. The issue was that he coded it in Visual Basic and I need it in C#. I tried using a converter but it didnt fix the issue.
string iamtwit = ss("http://www.mailinator.com" + GetBetween(GetBetween(iamtwit1, matches.ToString(), "</a>"), "<a href=", ">"));MessageBox.Show(GetBetween(matches1.ToString(), "<a href="", Strings.Chr(34)));
Here is the original code:
Dim iamtwit As String = ss("http://www.mailinator.com" & GetBetween(GetBetween(iamtwit1, matches.ToString, "</a>"), "<a href=", ">"))
MsgBox(GetBetween(matches1.ToString, "<a href=""", Chr(34)))
The error messages I am getting are:
The name 'GetBetween' does not exist in the current context
The name 'Strings' does not exist in the current context
View 3 Replies
ADVERTISEMENT
Jun 7, 2011
I'm converting a python application to VB.net
a = 'abcdef'
b = re.compile('[' + a + ']{3,}$', re.I)
Is it possible to convert it to Visual Basic, if so, can you provide any code?
View 1 Replies
Oct 21, 2010
i have tried various ways to accomplish this, but to no avail. I don't know how to generate the replacement text (mailto link) so I just used a bunch of x's until I can figure it out. Here is what I have (which currently not replacing emails in string): Here is my Code behind:
[Code]...
View 4 Replies
Apr 5, 2012
I am having an issue where I am using regex.Replace to replace part of a string. The basic idea is that I want to capture the beginning of the string then replace the end of the string with a value from code. For an example pretend I have a string that says "Test Number " followed by number and I want to increment that number. I capture the "Test Number " but when I try to concatenate that capture with the new number it treats the capture ($1) as a literal and replaces the entire string with $1[new number].
[code]...
This will output "We are on Test Number 2", as expected. how I can use a variable in the replacement string portion of the Regex.Replace when including a captured group?
View 1 Replies
Feb 23, 2012
I want to take the text and some special characters between the xml tags.. My input file contains:
[Code]...
now i want the Regex to take text and the special characters between the tags <line>,<inline>..
View 2 Replies
Jun 21, 2012
I'm creating a program in VB.NET to output multiple images. Some images will have the same file name. If there is multiple files with the same name I want to add "_1_" to the end of the file name. If the "_1_" file already exists I want to increment the 1 to be "_2_". If this file already exists I want to continue incrementing the number ultil it doesn't exist. So for example "filename", filename_1_", "filename_2_", etc. Here is the code that I have tried
[Code]...
View 1 Replies
Nov 17, 2011
I've been working straight since yesterday trying to get this to work. I'm a noob to RegEx and I've tested out about 5 different RegEx "builders" but each of them require you to navigate through the options to build the Regex...each of them has failed when I try to use them.Is there an application out there free/paid where you select the line you want to grab and the RegEx is auto generated from that highlight rather than having to try to build the line of code? [code]
View 1 Replies
Aug 22, 2011
my goal is to
1.Take an file(exe,dll,etc)
2.Convert it into hex
3.place that hex values in a stack
4.Execute the values inside the stack to its original form(i.e. take the elements out of stack and then convert it to a compile format)
Imports System.IO
Sub Main()
Dim fileName As String = "ABC.exe"
[code]....
View 1 Replies
Mar 12, 2012
I am using UrlRewriter.NET for urlrewriting...how do i write the regular expression for
[URL]
in this format <rewrite url = "~/ViewProfile/([^/.]+)" to="~/ViewProfile.aspx?uid=$1" /> what should be the rewrite url for [URL]
EDIT: Rewrite code in web.config file
<configuration>
<configSections>
<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
[code]....
View 1 Replies
Sep 28, 2011
I got xml document I want to parse. Here is example:[code]I want to get list of those to textbox like item1:1 newline item2:2 newline item3:3So its just like name+id and same for next..But sofar I got only item1 newline item2 newline item3
View 6 Replies
Apr 9, 2012
I've got an application which loads up some Excel files and imports them into a database.There are only certain of the sheets which I want, which are all timestamped and have either an am or pm on them. I put together a regex expression to look for that in the sheet name and skip it if it doesn't meet that criteria as:
View 6 Replies
Jun 15, 2009
i would like to use the following regex in VB.net:(d+.d+)|(??????)
how would i do it? i actually need to edit a string to put it in the specified format
View 2 Replies
Apr 8, 2011
i have a string similar to this one:
Hi, <<
ame>> <<surname>>, this is an example << est>>.
I what a regex that match and split this string in:
"Hi, "
<<
ame>>
" "
[code]....
I tried this one: (<<*.*?>>)|(>>*.*?<<), but doesn't work.
View 2 Replies
May 31, 2010
Well I am currently trying to get the word/text in between these 2 things
[Code]...
View 1 Replies
Jan 14, 2011
I have a html like this :
<h1> Headhing </h>
<font name="arial">some text</font></br>
some other text
In C#,
I want to get the out put as below. Simply content inside the font start tag and end tag
<font name="arial">some text</font>
View 3 Replies
Sep 11, 2010
I'm currently trying to get a regular expression to work and I can't seem to get it to, I've used the regex that I am using on an online tester and the text that I'm searching for is being selected alright, but I don't appear to be able to get it to work in VB.Net, so I was wondering if anyone would be willing to give me a hand.
The code I have is;
Private Sub getLink(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)
[code].....
View 3 Replies
Aug 12, 2011
I would like to use regex for a txt file as follows. What I want to do is to get the whole text if CRC is other than 00000000. The content of the file below has 2 blocks of data below. And I should get the second one after the regex operation.
[Code]...
View 3 Replies
Apr 9, 2011
I'm using REGEX to scan the following two bits of javascript and get the stream url in the javascript codes below the regex.
REGEX:
Dim matchs As MatchCollection = New Regex("(window.SC.bufferTracks.push(){1}[^)^;]*();){1}").Matches(input)
Dim match As Match
For Each match In matchs[code].....
why it's working on one javascript, but not the other? (i've tested it on several, and it works on some and not on the others
View 4 Replies
Aug 11, 2010
How can i get the String Between this I tried everything but I just cant make it:
This is the String:
Quote:
<a title="I Need this String" href="/page/view_7894135/I_Need_This_String.html" class="tinylink">I Need this String</a>
This was my RegEx but it doesent work. I tried everything:
(?<=title="">).+(?="")
View 5 Replies
Jun 8, 2012
the string ordering does not matter Z, X, or c can be any order in the string but the regex must fail if all three are not present. I can easily do Three different regex but was wonder can this be done with one expression?
View 12 Replies
Jul 22, 2010
I want create macro for replacing. But my problem is how to use regular expression in Visual Basic's macro for Visual Studio?
document.Selection.ReplacePattern("test{[^']+}test", "testAAAAtest")
Doesn't work.
View 1 Replies
Mar 8, 2011
Use RegEx to get an Image URL?[code]...
View 3 Replies
May 1, 2011
I am using LINQ and RegEx to select a list of files that need to be zipped, based on information given by the user (includefiles and excludefiles) .
This code works great until there is an escape character in the path, such as C:Program Files(x86). At that point, no files are selected for zipping.
I'm very unfamiliar with LINQ and RegEx, but I think I need Regex.Escape("(") (plus any other characters). I just don't know how I should go about putting it into the code.
I can't find any examples that use LINQ and also include Regex.Escape.
Dim DI As New DirectoryInfo(sDirectory)
Dim FileList As IEnumerable = From F In DI.GetFiles("*.*", SearchOption.AllDirectories) _
[Code]....
View 1 Replies
Jun 17, 2009
i am not sure how to use those as a regex coding so basically i need help with translating the following shown below into regex coding: -(e.g. car as regex = new regex(" ") )
1. Car Licence Number (e.g.1ASD324)
2. Date(e.g. dd/mm/yy)
View 2 Replies
Dec 12, 2010
I am trying to validate a password by using a regex.
* Must be between 6 to 16 characters long
* Must contain atleast 1 uppercase letter
* Must contain atleast 1 lowercase letter
* Must contain atleast 1 numeric "digit"
So far so good ...
(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,16})$
Can optionally have any number of special characters listed below.
View 2 Replies
Aug 1, 2011
I have :
[Code]...
I think I have explained my problem properly..
View 2 Replies
Dec 13, 2011
I have a RegEx I am using in vb.net and i can get all the matches of the text but i want to get the first match of the text, this is what i am using.
[Code]...
View 1 Replies
May 5, 2011
I need to insert a word after every X (i.e. 4,5,6 etc) sentences in given text. I feel regex would be compact and good solution. To be specific, I need to do this in .net. regex can't identify some sentences ending with not so common punctuation, I am fine with it. I don't need 100% accuracy)
View 3 Replies
Nov 4, 2010
Say I have this list (with unknown delimiters):
ABC-12345, DEF-34567; WER-12312
ERT-23423
I know the regex to mach what I need is: [A-ZÆØÅ]{3}-d{5}. But how do I use the Group or Capture of the .net Match class?
This is my first attempt:
Public Function ParseSites(ByVal txt As String) As List(Of String)
Const SiteIdRegEx = "([A-ZÆØÅ]{3}-d{5})"
Dim list As New List(Of String)
[Code].....
View 2 Replies
Feb 28, 2009
I have found a Regex that test if the text passed to a TextBox is an email.
If Regex.IsMatch(email.Text, "^(?("")("".+?""@)|(([0-9a-zA-Z]((.(?!.))|[-!#$%&'*+/=?^`{}|~w])*)(?<=[0-9a-zA-Z])@))" + "(?([)([(d{1,3}.){3}d{1,3}])|(([0-9a-zA-Z][-w]*[0-9a-zA-Z].)+[a-zA-Z]{2,6}))$") _
[code]....
View 4 Replies