Select to view content in your preferred language

Dynamic Text and Text Formatting Tag Parser/Method/Regex

617
3
10-05-2011 05:36 AM
MeToo
by
Deactivated User
Hi:

I need to parse both dynamic text and text formatting tags to get to the actual displayed text string. I couldn't find an ArcObjects method that does that.

Has anybody developed such parser and if so how can I access it? I would expect that it would be based on Regular Expresssions (regex). I am using .NET.

Thanks,
Dennis
0 Kudos
3 Replies
MeToo
by
Deactivated User
0 Kudos
JamesCrandall
MVP Alum
Hi:

I need to parse both dynamic text and text formatting tags to get to the actual displayed text string. I couldn't find an ArcObjects method that does that.

Has anybody developed such parser and if so how can I access it? I would expect that it would be based on Regular Expresssions (regex). I am using .NET.

Thanks,
Dennis


Without knowing exactly what it is you are attempting to accomplish, here's a very simple example of how to use Regex.  The result would be the MsgBox popup as "blah2".

(also: you will need Imports System.Text.RegularExpressions)
           
            Dim theString As String = "blah1 blah2 blah3"
            Dim rx As New Regex("blah2(.*?)")
            Dim matches As MatchCollection = rx.Matches(theString)

            For Each match As Match In matches
                Dim groups As GroupCollection = match.Groups
                MsgBox("Found :" & groups.Item(0).Value() & groups.Item(1).Value)
            Next


Hope this helps!
0 Kudos
MeToo
by
Deactivated User
Thanks,
Dennis
0 Kudos