<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style>
<!--
@font-face
        {font-family:Wingdings}
@font-face
        {font-family:Wingdings}
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Tahoma}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
span.EmailStyle18
        {font-family:"Calibri","sans-serif";
        color:windowtext}
span.EmailStyle19
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
.MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
ol
        {margin-bottom:0in}
ul
        {margin-bottom:0in}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" lang="EN-US" link="blue" vlink="purple">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">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>
<font face="Courier New">##############################<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</font><br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF898349"><font color="#000000" face="Tahoma" size="2"><b>From:</b> mapserver-users-bounces@lists.osgeo.org [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; mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> Re: [mapserver-users] class expression question<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">You can use regexes:</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">CLASSITEM ‘road_type’</span></p>
<p class="MsoNormal"><span style="color:#1F497D">CLASS</span></p>
<p class="MsoNormal"><span style="color:#1F497D">  EXPRESSION /^I-/</span></p>
<p class="MsoNormal"><span style="color:#1F497D">  …</span></p>
<p class="MsoNormal"><span style="color:#1F497D">END</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">or </span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">CLASS</span></p>
<p class="MsoNormal"><span style="color:#1F497D">  EXPRESSION (‘[road_type]’ ~ ‘^I-‘)</span></p>
<p class="MsoNormal"><span style="color:#1F497D">   …</span></p>
<p class="MsoNormal"><span style="color:#1F497D">END</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">Steve</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </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""> mapserver-users-bounces@lists.osgeo.org [mailto:mapserver-users-bounces@lists.osgeo.org]
<b>On Behalf Of </b>Bistrais, Bob<br>
<b>Sent:</b> Thursday, September 05, 2013 10:40 AM<br>
<b>To:</b> mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> [mapserver-users] class expression question</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal">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-%’</p>
<p class="MsoNormal"> </p>
<p class="MsoListParagraph" style="text-indent:-.25in"><span style="">-<span style="font:7.0pt "Times New Roman"">         
</span></span>What is the correct syntax to do this? </p>
</div>
</div>
</div>
</div>
</body>
</html>