<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
p.msochpdefault, li.msochpdefault, div.msochpdefault
        {mso-style-name:msochpdefault;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Times New Roman","serif";}
span.emailstyle18
        {mso-style-name:emailstyle18;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.emailstyle19
        {mso-style-name:emailstyle19;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle24
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Thanks Bob!  I’ve been able to figure out a working regex.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Basques, Bob (CI-StPaul) [mailto:bob.basques@ci.stpaul.mn.us]
<br>
<b>Sent:</b> Thursday, September 05, 2013 12:23 PM<br>
<b>To:</b> mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> Re: [mapserver-users] class expression question<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">Bob,<br>
<br>
I do it this way (you'll need to figure out your specific REGEX though, I have a column (F_CLASS) for classifying the HIGHWAY labels in the data)<br>
<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">##############################<br>
## Symbols (Shields, etc)<br>
##############################<br>
<br>
  LAYER<br>
    METADATA<br>
      "ows_title" "road_sym"<br>
      "gml_include_items" "all"<br>
    END<br>
     NAME 'road_sym'<br>
    GROUP 'interstate_poly'<br>
    #TILEINDEX 'TILEINDEX'<br>
    DATA 'DATA/A10A20A25A30'<br>
    STATUS DEFAULT<br>
    TYPE ANNOTATION<br>
    CLASSITEM 'F_CLASS'<br>
    LABELITEM 'HIGHWAY_NU'<br>
    TOLERANCE 1000<br>
    CLASS<br>
      EXPRESSION 'A10' # interstates<br>
      STYLE<br>
        SYMBOL 'interstate1_wide_back'<br>
        SIZE 22<br>
        COLOR 255 0 0<br>
      END<br>
      STYLE<br>
        SYMBOL 'interstate1_wide_front'<br>
        SIZE 22<br>
        COLOR 115 113 206<br>
        OUTLINECOLOR 254 254 254<br>
      END      <br>
      LABEL<br>
        TYPE TRUETYPE<br>
        FONT bluehigh<br>
        SIZE 12<br>
        COLOR 254 254 254<br>
        MINDISTANCE 200<br>
        MINFEATURESIZE 10<br>
        OFFSET 0 0<br>
        PARTIALS FALSE<br>
      END<br>
    END<br>
    <br>
    CLASS<br>
      EXPRESSION 'A20' # US Highway<br>
      STYLE<br>
        SYMBOL 'us_highway_back'<br>
        SIZE 23<br>
        COLOR 254 254 254<br>
      END<br>
      STYLE<br>
        SYMBOL 'us_highway_front'<br>
        SIZE 23<br>
        COLOR 0 0 0<br>
      END<br>
      LABEL<br>
        TYPE TRUETYPE<br>
        FONT bluehigh<br>
        SIZE 11<br>
        COLOR 0 0 0<br>
        MINDISTANCE 250<br>
        MINFEATURESIZE 15<br>
        OFFSET 0 -1<br>
        PARTIALS FALSE<br>
      END<br>
    END<br>
    <br>
    CLASS<br>
      EXPRESSION 'A25' # MN Highway<br>
      STYLE<br>
        SYMBOL 'mn_highway_back'<br>
        SIZE 23<br>
        COLOR 254 254 254<br>
      END<br>
      STYLE<br>
        SYMBOL 'mn_highway_front'<br>
        SIZE 23<br>
        COLOR 0 0 0<br>
      END<br>
      LABEL<br>
        TYPE TRUETYPE<br>
        FONT bluehigh<br>
        SIZE 11<br>
        COLOR 0 0 0<br>
        MINDISTANCE 250<br>
        MINFEATURESIZE 15<br>
        OFFSET 0 -1<br>
        PARTIALS FALSE<br>
      END<br>
    END</span><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black"><o:p></o:p></span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:black">
<hr size="2" width="100%" align="center">
</span></div>
<div id="divRpF898349">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">
<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> [mapserver-users-bounces@lists.osgeo.org] on behalf of Lime, Steve D (MNIT) [Steve.Lime@state.mn.us]<br>
<b>Sent:</b> Thursday, September 05, 2013 10:45 AM<br>
<b>To:</b> Bistrais, Bob; <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [mapserver-users] class expression question</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:#1F497D">You can use regexes:</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">CLASSITEM ‘road_type’</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">CLASS</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">  EXPRESSION /^I-/</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">  …</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">END</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">or </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">CLASS</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">  EXPRESSION (‘[road_type]’ ~ ‘^I-‘)</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">   …</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">END</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Steve</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><span style="color:black"><o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">
<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> [<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mailto:mapserver-users-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Bistrais, Bob<br>
<b>Sent:</b> Thursday, September 05, 2013 10:40 AM<br>
<b>To:</b> <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<b>Subject:</b> [mapserver-users] class expression question</span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">I’d like to classify road data according to road type.  This includes Interstate highways, where the road name attribute starts with “I-“, such as “I-95”, “I-295”, etc.  So I’d like to create a class where ‘[roadname]’
 like ‘I-%’<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in"><span style="color:black">-</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:black">         
</span><span style="color:black">What is the correct syntax to do this? <o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>