Imports System.Text.RegularExpressions
Imports System
Module Module1
Function ExtrairBlocos(ByVal texto As String) As List(Of String)
Dim blocos As New List(Of String)
blocos = Regex.Split(texto, "(""[^""]*""|\s+)").ToList()
blocos.RemoveAll(Function(bloco) String.IsNullOrWhiteSpace(bloco))
Return blocos
End Function
Sub Main()
Dim texto As String = "if ""esse campo tem espaços"" = true"
Dim blocos As New List(Of String)
'blocos = ExtrairBlocos(texto)
'For Each bloco As String In blocos
' Console.WriteLine("{0}", bloco)
'Next
Console.ReadLine()
End Sub
End Module
SW1wb3J0cyBTeXN0ZW0uVGV4dC5SZWd1bGFyRXhwcmVzc2lvbnMKSW1wb3J0cyBTeXN0ZW0KCk1vZHVsZSBNb2R1bGUxCgogICAgRnVuY3Rpb24gRXh0cmFpckJsb2NvcyhCeVZhbCB0ZXh0byBBcyBTdHJpbmcpIEFzIExpc3QoT2YgU3RyaW5nKQogICAgICAgIERpbSBibG9jb3MgQXMgTmV3IExpc3QoT2YgU3RyaW5nKQogICAgICAgIGJsb2NvcyA9IFJlZ2V4LlNwbGl0KHRleHRvLCAiKCIiW14iIl0qIiJ8XHMrKSIpLlRvTGlzdCgpCiAgICAgICAgYmxvY29zLlJlbW92ZUFsbChGdW5jdGlvbihibG9jbykgU3RyaW5nLklzTnVsbE9yV2hpdGVTcGFjZShibG9jbykpCiAgICAgICAgUmV0dXJuIGJsb2NvcwogICAgRW5kIEZ1bmN0aW9uCgogICAgU3ViIE1haW4oKQogICAgICAgIERpbSB0ZXh0byBBcyBTdHJpbmcgPSAiaWYgIiJlc3NlIGNhbXBvIHRlbSBlc3Bhw6dvcyIiID0gdHJ1ZSIKICAgICAgICBEaW0gYmxvY29zIEFzIE5ldyBMaXN0KE9mIFN0cmluZykKICAgICAgICAnYmxvY29zID0gRXh0cmFpckJsb2Nvcyh0ZXh0bykKCiAgICAgICAgJ0ZvciBFYWNoIGJsb2NvIEFzIFN0cmluZyBJbiBibG9jb3MKICAgICAgICAnICAgIENvbnNvbGUuV3JpdGVMaW5lKCJ7MH0iLCBibG9jbykKICAgICAgICAnTmV4dAogICAgICAgIENvbnNvbGUuUmVhZExpbmUoKQogICAgRW5kIFN1YgoKRW5kIE1vZHVsZQo=
Visual Basic.Net Compiler version 0.0.0.5943 (Mono 3.8 - tarball)
Copyright (C) 2004-2010 Rolf Bjarne Kvinge. All rights reserved.
/home/nt3FDD/prog.vb (9,35) : error VBNC90019: Expected ')'.
/home/nt3FDD/prog.vb (9,35): Compiler error around this location, the compiler hasn't implemented the error message, nor error recovery, so the compiler will probably crash soon.
at vbnc.Helper.ErrorRecoveryNotImplemented(Span Location)
at vbnc.Parser.ParseInvocationOrIndexExpression(vbnc.ParsedObject Parent, vbnc.Expression First)
at vbnc.Parser.ParseIdentifier(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParseExponent(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParseUnaryPlusMinus(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParseMultDiv(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParseIntDiv(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParseMod(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParsePlusMinus(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParseConcat(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParseBitshift(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParseComparison(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParseNot(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParseAnd_AndAlso(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParseOr_OrElse_Xor(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParseExpression(vbnc.ExpressionParseInfo Info)
at vbnc.Parser.ParseCodeBlock(vbnc.ParsedObject Parent, Boolean IsOneLiner)
at vbnc.Parser.ParseFunctionDeclaration(vbnc.TypeDeclaration Parent, vbnc.ParseAttributableInfo Info)
at vbnc.Parser.ParseTypeMembers(vbnc.TypeDeclaration Parent)
at vbnc.Parser.ParseModuleDeclaration(vbnc.ParsedObject Parent, vbnc.Attributes Attributes, System.String Namespace)
at vbnc.Parser.ParseTypeDeclaration(vbnc.ParsedObject Parent, vbnc.Attributes Attributes, System.String Namespace)
at vbnc.Parser.ParseAssemblyMembers(vbnc.AssemblyDeclaration Parent, System.String RootNamespace)
at vbnc.Parser.ParseAssemblyDeclaration(System.String RootNamespace, vbnc.AssemblyDeclaration assembly)
at vbnc.Parser.Parse(System.String RootNamespace, vbnc.AssemblyDeclaration assembly)
at vbnc.Compiler.Compile_Parse()
at vbnc.Compiler.Compile()
at vbnc.Compiler.Compile(System.String[] CommandLine)
at vbnc.Main.Main(System.String[] CmdArgs)
/home/nt3FDD/prog.vb (9,35) : error VBNC90019: Expected 'End'.
/home/nt3FDD/prog.vb (10,15) : error VBNC90019: Expected 'End'.
/home/nt3FDD/prog.vb (11,17) : error VBNC30203: Identifier expected.
/home/nt3FDD/prog.vb (13,8) : error VBNC30203: Identifier expected.
/home/nt3FDD/prog.vb (14,12) : error VBNC30203: Identifier expected.
/home/nt3FDD/prog.vb (15,12) : error VBNC30203: Identifier expected.
/home/nt3FDD/prog.vb (21,16) : error VBNC30203: Identifier expected.
/home/nt3FDD/prog.vb (22,12) : error VBNC30203: Identifier expected.
/home/nt3FDD/prog.vb (24,11) : error VBNC30203: Identifier expected.
There were 10 errors and 0 warnings.
Compilation took 00:00:00.6409320