Hi,
I would like to match a string that starts with RFF+ folllowed by 2 or 3 characters and followed by colon(:).
For instance accepted values are :
RFF+AUN:
RFF+MO:
RFF+NAS:
...
Thanks
View Complete Post
I am working on a site where I use the Split function on a string.
To make sure I used a separator character that I do not use anywhere in the data I selected the character 'ã'.
This worked fine in Firefox and Safari, but in IE8 I get an 'Index out of range' error, so apparently the 'ã' character is not handled correctly.
I changed the separator to ';', and then it works fine.
Cheers,
Johnny
Now you can perform efficient, sophisticated text analysis using regular expressions in SQL Server 2005.
David Banister
MSDN Magazine February 2007
I have a string that looks like this: pic1*pic2*pic3*
I want to take out every pic from the string like this:
pic1pic2pic3
I got the first pic but how do i get the other two?
Dim line as string = "pic1*pic2*pic3*" Dim pic1 As String Dim pic2 As String Dim pic3 As String pic1 = line.Substring(0, line.IndexOf("*")) pic2 = ? pic3 = ?
hi, Currently, I have a listbox that the selected items are inserted into the database by a string. Now I need to add a new feature that the searches are suppose to be postback individually so the selected values from the listbox need to be inserted into the database individually so the search can work. Is it possible to split an string into separate variables or into an array? Thanks for your help,Carlos Following is my store procedure and my back code:
Currently, I have a listbox that the selected items are inserted into the database by a string. Now I need to add a new feature that the searches are suppose to be postback individually so the selected values from the listbox need to be inserted into the database individually so the search can work. Is it possible to split an string into separate variables or into an array?
Thanks for your help,
Carlos
Following is my store procedure and my back code:
<script runat="server"> Protected Sub insertcompanydata_click1(ByVal sender As Object, ByVal e As EventArgs) Dim tobresults2 As String Dim li As ListItem Dim myArrayList As ArrayList = New ArrayList() Dim strarr() As String For Each li In txttoblb.Items If li.Selected = True Then myArrayList.Add(li.Text) End If Next strarr = myArrayList.ToArray(Type.GetType("System.String")) tobresults2 = String.Join(", ", strarr) Dim txtloblb1 As String Dim lin As ListItem Dim myArrayList1 As ArrayList = New ArrayList() Dim strarr1() As String
Hi!
I need some help here. I have a document containing some string like the following:
TypeName="$Ref-7a1df965df8b43a19f3bcb0928340392BusinessGoal"
Now what I need is that I need to extract this "BusinessGoal" which as you can see, is 32 characters ahead after "-" (hyphen) and change it's case to uppercase.
The real challange is that, This "BusinessGoal" should only be replaced only and only where there is "Ref-<any 32 characters>" before it and not all. So if I find something like TypeName = "BusinessGoal" it will be simply ignored.
So how am I going to make that reg Ex. I think it would be a combination of Regex and String Api.
Kindly help me out.
Thanks and regards
hi all
i want to spilt 115:USD:LKR this string from oracle script. return value should be 115.
pls provide me sql script
thanks
Hi everybody,
How can I split a string from some word.
string test = "Hellow world one two three";
I would lile to get the string part after the word world?? The result will be after splitting the string: "one two three"
I have a table called SubjectRank that provides subject and it's ranking.
I have a string that can be in any format. It can be 'hello cat, how -are you lion?' or 'yes horse'. In short it can be received in any manner and i have no control on how user sends the string.
What I need to do is check if the string contains any words in the subject column. If yes I need to return that word.
In addition if the string contains more than one subject from the table than I must check the ranking and return the value with the highest ranking. (1 lowest) So if the string contains 'hello cat, how -are you lion?' the sp must return the word lion.
How can I achieve this?
Rank
Subject
String.Split with with tab as separator I should read the substrings of this file: 1 1 -1738.20118241 6787.03549108 2 2 -1803.20118241 6759.73549108 3 3 -2193.20118241 6759.73549108 I haved used the tab control "\t" as the separator (there is a tab character between the columns): Dim separator() As String = {"\t"} Console.WriteLine("separator(0) = {0}", separator(0)) Try ' Open the file to read from. Using sr As StreamReader = File.OpenText(nomeFile) Do While sr.Peek() >= 0 'Dim line As New StringBuilder Dim stringline As String Dim stringarray As String() Dim x, y, canale need help in pattern matching I have below XML schema which prompt me error when my <Attachment> node has null values, I need validation that attachment value should must have a period (.) sign and there should be some varchar text on both side of period. ex, file1.doc, file2.pdf, file3.jpeg, etc.... Please help <Test><Attachment>file1.doc</Attachment></Test> Below the schema, CREATE XML SCHEMA COLLECTION [dbo].[Test_Schema] AS N'<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Test"> <xs:complexType> <xs:sequence> <xs:element name="Attachment" type="NoneEmptyVals" /> </xs:sequence> </xs:complexType> </xs:element> <xs:simpleType name="NoneEmptyVals"> <xs:restriction base="xs:string"> <xs:minLength value="1" /> </xs:restriction> </xs:simpleType> </xs:schema>' and here I check XML, Split String on underscore Hi I have a long string and i want to split it on the bases of case change and underscore. here is the following pattern that split on the case change but i also want to split it on the underscore. Can somebody help me out. private static final String DIVIDER_PATTERN = "(?<=[^\\p{Upper}])(?=\\p{Upper})" + "|(?<=[\\p{Lower}])(?=\\d)"; this pattern split "MyFamilyNameIsFar" to "My Family Name Is Far" but i also want to split if there is underscore. like "MyFamily_NameIs_Far" to "My Family Name Is Far" Can somebody tell me which modification i need in this pattern to handle these kind of situation. your help would be appreciated. With Best Regards Matching every third word in a comma delimited string. Hello all, I have to write a .NET program that accepts a string of comma delimited values. I want to write a regular expression to accept every third value (starting with the sixth). I have a regex to skip the first three values and return groups of three: (?<=(\w*,\w*,\w*,))\w*,\w*,\w* Now I need something to skip the first two words within each group. Any suggestions? Thanks in advance Matching C# methods with a pattern finding the Public, Private, etc modifiers and balancing the curl Hello all, For a large conversion project, we need to match certain key words within C# methods and remove the entire method if found. I know .Net has a feature that allows balanced matching on the curly braces, but I am not sure how to implement it. In a two step process, you could match the modifiers Public, Private, etc and their balanced curly braces to identify the methods and then remove those that contained the key words. In a one step process, I think you could use a positive lookahead for the key words as well. Could someone help me with the pattern that has the balanced curly brace logic with the modifiers to identify the methods? Thanks in advance for any ideas and/or suggestions. Have a great day!
I should read the substrings of this file:
1 1 -1738.20118241 6787.03549108 2 2 -1803.20118241 6759.73549108 3 3 -2193.20118241 6759.73549108
I haved used the tab control "\t" as the separator (there is a tab character between the columns):
Dim separator() As String = {"\t"} Console.WriteLine("separator(0) = {0}", separator(0)) Try ' Open the file to read from. Using sr As StreamReader = File.OpenText(nomeFile) Do While sr.Peek() >= 0 'Dim line As New StringBuilder Dim stringline As String Dim stringarray As String() Dim x, y, canale
I have below XML schema which prompt me error when my <Attachment> node has null values,
I need validation that attachment value should must have a period (.) sign and there should be some varchar text on both side of period.
ex, file1.doc, file2.pdf, file3.jpeg, etc.... Please help
<Test><Attachment>file1.doc</Attachment></Test>
Below the schema,
CREATE XML SCHEMA COLLECTION [dbo].[Test_Schema] AS N'<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Test"> <xs:complexType> <xs:sequence> <xs:element name="Attachment" type="NoneEmptyVals" /> </xs:sequence> </xs:complexType> </xs:element> <xs:simpleType name="NoneEmptyVals"> <xs:restriction base="xs:string"> <xs:minLength value="1" /> </xs:restriction> </xs:simpleType> </xs:schema>'
and here I check XML,
Hi
I have a long string and i want to split it on the bases of case change and underscore. here is the following pattern that split on the case change but i also want to split it on the underscore. Can somebody help me out.
private static final String DIVIDER_PATTERN = "(?<=[^\\p{Upper}])(?=\\p{Upper})" + "|(?<=[\\p{Lower}])(?=\\d)";
this pattern split "MyFamilyNameIsFar" to "My Family Name Is Far" but i also want to split if there is underscore. like
"MyFamily_NameIs_Far" to "My Family Name Is Far"
Can somebody tell me which modification i need in this pattern to handle these kind of situation.
your help would be appreciated.
With Best Regards
Hello all,
I have to write a .NET program that accepts a string of comma delimited values. I want to write a regular expression to accept every third value (starting with the sixth). I have a regex to skip the first three values and return groups of three:
(?<=(\w*,\w*,\w*,))\w*,\w*,\w*
Now I need something to skip the first two words within each group. Any suggestions?
Thanks in advance
For a large conversion project, we need to match certain key words within C# methods and remove the entire method if found. I know .Net has a feature that allows balanced matching on the curly braces, but I am not sure how to implement it.
In a two step process, you could match the modifiers Public, Private, etc and their balanced curly braces to identify the methods and then remove those that contained the key words. In a one step process, I think you could use a positive lookahead for the key words as well.
Could someone help me with the pattern that has the balanced curly brace logic with the modifiers to identify the methods? Thanks in advance for any ideas and/or suggestions.
Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend