.NET Framework Bookmark and Share   
 index > Regular Expressions > Regular Expression - String variable which has a " character
 

Regular Expression - String variable which has a " character


i use getmatch function in order to find match of the regular expre. in the resultlink string. I stored the regular expression to the database and use appropriate expressions when needed. The codes work fine for; getmatch(rowslink(ii)("re_pricekdv").ToString which is actually <hemenalkdvdahilfiyat>(\d*\.*\d*.*\d*,\d*). Bu it does not work for rowslink(ii)("re_stokestate").ToString which is actually UrunBilgisiStokDurumDegerTd\"">: (\b\w*\b)
ı guess it is because of the " character inside the string but i could not find any solution for the issue?

objCommand.Parameters(
"@pricekdv").Value = getmatch(rowslink(ii)("re_pricekdv").ToString, resultslink)

objCommand.Parameters(

"@stock_state").Value = getmatch(rowslink(ii)("re_stokestate").ToString, resultslink)






Function






Function

getmatch(ByVal re_expression As String, ByVal re_text As String) As String

Dim Regex As System.Text.RegularExpressions.Regex

Regex =

New System.Text.RegularExpressions.Regex(re_expression, System.Text.RegularExpressions.RegexOptions.Compiled)

Dim match As Match = Regex.Match(re_text, re_expression)

getmatch = match.Groups(1).Value()

End Function

Erdem ISBILEN

issue is resolved. need to use single " in opose to the double "" used in reg.expression pattern

Erdem ISBILEN

issue is resolved. need to use single " in opose to the double "" used in reg.expression pattern

Erdem ISBILEN

You can use google to search for other answers

Custom Search

More Threads

• Regular expression best practice
• Extracting hyperlinks
• Regular Expression to replace img tag
• Regular Expressions and Labels
• Email length
• Regex to find missing content
• how to flatten auto-scripted query to one line.
• a Problem in RFC 2141 (URNs)
• Remove HTML unwanted tags and attributes
• Head scratching regex problem for a newbie