[DFDL-WG] regex free-spacing mode

Mike Beckerle mbeckerle.dfdl at gmail.com
Wed Jun 26 13:13:42 EDT 2013


I wrote this complicated regex today and it works in Daffodil.

Question is this. Is the (?x) which turns on regex free-spacing mode,
officially supported in DFDL?

You can see from below that it is VERY desirable that it works.....

  <xs:simpleType name="frontMatterType">
      <xs:annotation>
        <xs:appinfo source="http://www.ogf.org/dfdl/">
          <dfdl:simpleType lengthKind="pattern" terminator="%FF;">

            <dfdl:property name="lengthPattern"><![CDATA[(?x) # regex free
spacing mode
            #
            # match the front matter of the document
            #
            .{1,8192}?                # up to 8K of front matter content
            #
            # front matter ends at the first message description page
            #
            (?=                       # lookahead (followed by but not
including...)
              \f                      # a formfeed character
              (?> \s | \x08 ){1,100}? # whitespace or backspace (x08)
              MESSAGE\ DESCRIPTION\r  # this literal text
              \s{1,100}?              # up to 100 whitespaces
              -{19}\r                 # exactly 19 hyphens and a CR
            )                         # end lookahead
            ]]></dfdl:property>

           </dfdl:simpleType>
        </xs:appinfo>
      </xs:annotation>
      <xs:restriction base="xs:string" />
    </xs:simpleType>

-- 
Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology |
www.tresys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20130626/58840480/attachment.html>


More information about the dfdl-wg mailing list