Form A Regex To Get The Numbers From A Giving String With Certain Conditions?

Nov 1, 2011

I have a string like this

(THQ836721='Yes' and BRQ836716='Yes') or (BRQ836717='Yes') and (THQ836728='Yes' and BRQ836756='Yes') or (BRQ836117='Yes') and (SYSQ123='No')

I need a Reg Ex to get the numbers after THQ,BRQ and SYSQMy string may smaller or shorter or may have any times of this THQ,BRQ or SYSQ.form a Reg eXpression to get the numbers .The length of numbers may vary I am using VB.Net in VS2008?

View 1 Replies


ADVERTISEMENT

.net - Parse Numbers From String Using Regex In .NET?

Feb 16, 2010

I am trying to parse the digits to store in a variable from a string in VB.NET (would like to also include the decimal point).

Here is an example string: Refund issued for $27.74

View 2 Replies

RegEx - How To Gather All Numbers In String

Sep 4, 2009

I am trying to gather all numbers in this string which is the name of an image file. The name of the string is ABC09072009XYZ777000111.jpg. When I use
Dim rx as new Regex("d")
Console.Writeline(rx.match(input))
It only returns the first set of numbers before the xyz. I need them all.

View 3 Replies

Regex - Import Phone Numbers From A String?

Jan 25, 2010

I am trying to wirte a function for a Phone number class called "import phone number". It should take any string with 10 digits in it somewhere (and allow for an extension), and import them into it's own properties: AreaCode, Prefix, Suffix, and Extension (aaa-ppp-ssss-xxxx...).

I check the input with a regex to make sure it's valid, now i want to tokenize those pieces into their respective properties. What I have looks like this (incomplete):

Public Sub ImportPhoneNumber(ByVal anyNumber As String)
'phone number is 10-digits long, e.g.: 012-345-6789
Dim reg_exp_10 As New Regex("^((D*)d(D*)){9}((D*)d){1}(((x|ext){1}(d)+)?|D*)$", RegexOptions.IgnoreCase)

[Code].....

View 1 Replies

Arranging Numbers - Get Equal Numbers And ELSE Giving All Series?

Dec 26, 2010

Sub five()
Dim i As Integer
For i = 1 To 14[code].....

I want the numbers that I was comparing similar numbers. I get equal numbers and ELSE giving all series.I like numbers 2 4 6 8 9 10

View 1 Replies

.net - Using Regex OR Operator To Solve 2 Conditions?

Apr 10, 2012

I am trying to combine 2 regular expressions into 1 with the OR operator: |

I have one that checks for match of a letter followed by 8 digits:

Regex.IsMatch(s, "^[A-Z]d{8}$")

I have another that checks for simply 9 digits:

Regex.IsMatch(s, "^d{9}$")

[Code]...

Apparently I am not combining the two correctly and apparently I am horrible at regular expressions.And for those wondering, I did take a glance at How to combine 2 conditions and more in regex and I am still scratching my head.

View 5 Replies

Regex - Regular Expression To Extract Numbers From Long String Containing Lots Of Punctuation?

Aug 27, 2009

I am trying to separate numbers from a string which includes %,/,etc for eg (%2459348?:, or :2434545/%). How can I separate it, in VB.net

View 4 Replies

.net - Regex Test For NUMBERS?

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

Regex On Get Only First Few Numbers From Left To Right?

Aug 15, 2011

I am pretty new on regular expressions, but as far as I've been wandering around Google, the only thing I could do to solve my problem is through regex. I have a collection of strings which have patterns like these:

"3 - Orange, Lemon"
"4 - Pineapple, Orange"
"12 - Lime, Strawberry"

[Code]...

Only the first few numbers. A comment, suggestion, or point to the right links/articles would help because so far I couldn't manage to find a decent tutorials that easy to understand.

View 3 Replies

String To Compare With Another - Until Add The Variable Conditions To Task

Oct 29, 2010

I have a situation that I just can't seem to sort out in my head. What I have is a string that I would like to compare with another. Simple until I add the variable conditions to this task.

What I have is a string that looks like "t-EL" , "t-A" , "t-D" , "t-G" , "t-B" , or "t-EH" now the trouble both the strings could have characters leading these of following these. In every case there will be at lease One number after these ie "t-A0" or "t-A2" but could have a double digit number like "t-A13". Leading these strings could contain "!" or "#". In every case I'm only concerned with the character after the "-" but the trouble is some times I need to differentiate between the "EH" and "EL". I could find the location of the "-" and extract the next character and if it is "E" then the next two characters. Can we find a better way?

I might have come up with something by just typing this up Check it out... Seems to be working for me

Dim p1 As Long
Dim p2 As Long
Dim s1 As String = StringName

[CODE]...

View 2 Replies

Parse Numeric Values In String Form Into Real Numbers?

Sep 14, 2009

I have a string I want to parse. I could write the code to do so, but I figured that VS.NET has a parser that should do this for me.however, I can't find it. All the searches I do return info on how to parse numeric values in string form into real numbers. It would be nice if the MSDN search had some ways to allow users to enter more details than just search text and 3 ways to filter out irrelevant stuff. In any case, I also tried things like string.parse (nope - although I kinda figured this would be it.) I also looked at Enum.parse, but the code indicates that it works with arrasy of items, not strings.

View 5 Replies

Regex - Get The Numbers Surrounded A Character ?

Oct 27, 2011

I'm creating a calculator, and I need a way to get the numbers surrounded a character I provide.

For example:
Equation: 5+5*2/7
Character: *
Result: array(5, 2)

I was wondering if regex would be able to do this and if it can.

View 8 Replies

RegEx - International/Domestic Phone Numbers?

Mar 25, 2009

(^(+[1-9][0-9]*(([0-9]*)/-[0-9]*-))?[0]?[1-9][0-9-]*)/(^([0-9]( /-)?)?((?[0-9]{3})?/[0-9]{3})( /-)?([0-9]{3}( /-)?[0-9]{4}/[a-zA-Z0-9]{7}))$I'm trying to write a RegEx to check for International and Domestic phone numbers. This appears to be working for domestic phone numbers but it doesn't look to work for international numbers. Is there something I'm missing? Can anyone else try this with numbers you know and just let me know if it's missing anything?

View 1 Replies

RegEx 20 Real Numbers Separated With Commas?

Mar 11, 2010

I worked around to modifying regular expression below but i could't get what I need. I google it, many things found but not for what i want. Dim valid AS Boolean = Regex.IsMatch(TextBox1.Text, "^(,?d+){0,20}$")Allow numbers exactly like 32,1,6,32,12,21,21,54,675,8,4,3,2,9,0,21,21,21,43,744 in TextBox1. Perfect.

View 4 Replies

Giving A Dynamic String Name?

Apr 23, 2010

how do i give a string a dynamic name i.e. in the below for loop i want to create a string name using the item in question.

For i = 1 To NumNames
Dim userName & i.tostring As String
....
Next

View 3 Replies

DataGridView On A Form That Is Being Populated From A SQL Table Dataset By Giving Criteria From A Previous Form?

Apr 8, 2009

I have a DataGridView on a form that is being populated from a SQL table dataset by giving criteria from a previous form. I have 6 columns in the dataset, of which the last column should be combo box column containing items "Done" and "Pending". How do I make this bound column to a combo box column and display the value as well as the alternate item too in the combo box?

View 6 Replies

Regex - Separating Text From Numbers Using Regular Expressions?

Nov 7, 2010

I'm having trouble parsing some text. Here's an example of the text:

201 BBQ 0.000 9.000 0.099 0.891 9.000 0.000 0.000 0.000
705 W 1 PC 0.000 135.000 0.295 39.825 0.000 0.000 135.000 0.000
2106 ONL 9.99 41.141 3.000 4.110 12.330 3.000 0.000 0.000 29.970

Here's the latest incarnation of the code I've been trying:

objInfo = System.Text.RegularExpressions.Regex.Split(
newLine,"(d{3,5})|([0-9]+[.]+[0-9]+)|(w*)")

I'm having trouble because I'm avoiding getting many blank spaces in the array after splitting. I'm trying to avoid using the optional | character but I get no results when I set it up without it!

I've spent much of the evening reviewing regular expressions and I've downloaded the following programs:

RegEx Designer.NET
Antix RegEx Tester
Expresso

I'm having trouble because the description contains a decimal point SOMETIMES and sometimes it doesn't. The description sometimes contains a whole number sometimes it doesn't.My friend recommended I use awk to divide it into columns. The thing is...I teach a Community Education class with Visual Basic .Net and I need to improve my RegEx skills.

View 1 Replies

Regex - Textbox That Accepts All The Characters But Returns Only Numbers

Aug 1, 2011

I need the code to filter the data entered in a textbox. Although it accepts all the characters during runtime, the code should remove all the strings and alpha numeric characters except the numbers (which would be my output). I tried the following code but guess it won't do:

a = Textbox1.text
Dim value As Decimal = CDec(Regex.Replace(a, "[D]", ""))

View 3 Replies

Regex To Match 4 Groups Of Letters/numbers, Separated By Hyphens?

Jul 14, 2011

I need a regular expression that will match this pattern (case doesn't matter):066B-E77B-CE41-4279

View 4 Replies

Regular Expression (RegEx) To Replace Floating-point Numbers In XML?

Aug 22, 2011

I'm using Visual Basic 2010 Express to edit an XML file. I want to replace items that have (typically) non-zero floating point numbers with a single zero.

View 4 Replies

VS 2010 : Use Regex To Check If The User Add The Numbers Of Phone In This 'Formula'?

May 3, 2012

I need to use regex to check if the user add the numbers of phone in this 'Formula'

0911111111,0922222222,0933333333
must the number start with '09'
must the number contains '10' characters'
must the numbers seperated by Comaa ','

View 4 Replies

Text Box For User Input And Allow To Separate Conditions To Dictate Whether Literal Is Added To String

Jun 22, 2010

My app has text boxes to accept input from user to questions shown on labels. When the user input is valid, a literal is added to a string incorporating the user input. If the user doesn't input anything or if user inputs "no" or "None" I want the literal and the user input to not add to my string. Make any sense? See my code below:

[Code]...

View 6 Replies

Passing A Masked Telephone Number In The Form Of (999)999-9999 To A Function That 'strips' The Numbers Out And Puts Them Into A String?

Mar 10, 2009

So I'm passing a masked telephone number in the form of (999)999-9999 to a Function that 'strips' the numbers out and puts them into a string that I then use in an Update SQL statement. So far I have the code below that of course doesn't do anything:

Function StripPhone(ByVal sPhone as String) as String
Dim i as Integer
Dim sStripped as String

[code]....

View 6 Replies

Retrieving Data From A String Giving Error

Jun 29, 2009

Trying to run the following code but am receiving an string to integer error. Basically, I am running a report through code and trying to retrieve a number from a line of code by removing the line description and spaces. Having problems trying to figure out how to do that.

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strURL As String

[Code].....

View 3 Replies

Forms :: Best Approach To Checking Conditions Before Loading A Form

Feb 2, 2011

I have a form which asks for a username and password to connect to a MySQL database. Before I load the login form I would like to place a check to see if the connection information is stored in the My.Settings.<connection string..I am using Sub New() in the Form.Designer to do this by placing the following [code]The connection form does show but when i close the form there is a blank form that shows up.

View 3 Replies

IDE :: String.Format Giving Error - Input String Was Not In A Correct Format

Sep 14, 2011

var queryString = string.Format("filename={0}&filestream={1}&append={2)", fileName, Convert.ToBase64String(b, 0, bytesRead).ToString(), 1);

above line of code giving error 'Input string was not in a correct format.'

View 2 Replies

Configurationmanager.connection String Giving System.NullReferenceException Was Unhan?

May 24, 2011

I am in great trouble, I have a project on visual studio 2008 and I getting connectionstring using ConfigurationManager.ConnectionStrings("connestionstring") .ConnectionString. this project have a app.config file which contain

[code]...

View 4 Replies

Regex - How To Check If The Input String Is A Valid VB String

Mar 15, 2009

We know that VB string start and end with double quotes " "

So we have to use "" if we want " in VB string.

I wonder if there is a regular expression pattern which will match VB string?.

View 2 Replies

Using RegEx To Find String Inside Nested String?

Sep 10, 2011

Using VB.NET, Is there a way to do this RegEx call in 1 step... instead of 2-3? I'm trying to find the word "bingo", or whatever is between the START and END words, but then also inside the inner FISH and CAKES words. My final results should be just "bingo".

Dim s1 As String = "START (random string) FISH bingo CAKES (random string) END"

[Code]...

View 2 Replies

VS 2008 Webclient & Regex (Catch String) (One String - No More)

Aug 7, 2009

I'm here again asking stupid questions. I don't have really get this but i ask again but i try explain all better. Here is a website link and i want catch string from here. Look page's source code and find first what starts <td> someword </td> I use this code for catch word from page. Visual Basic Express 2008

[Code]...

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved