Match xml tags in User Define Dialog?

  • Warren Tang

    Warren Tang - 2008-10-30

    Hi everybody

    I am trying to create a user defined language for the httpd.conf file(Apache). Here is a sample of the file:

    # This is a commment line
    # From httpd.conf for Apache 

    <Directory  "D:/PHP/Samples"/>
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all

    # viewed by Web clients.
    <FilesMatch "^\.ht">
        Order allow,deny
        Deny from all
        Satisfy All

    The problem is how to match the begin and end XML tag. What I want to achieve is:
    1. Match all different tags(Directory, FilesMatch, etc.).
    2. Match the whole tag (e.g. <Directory  "D:/PHP/Samples"/> ).

    Can you help me? Thanks in advance.


    • Airdrik

      Airdrik - 2008-11-03

      I think you can go into the langs.xml file and put the '#' sign in the commentLine attribute for xml.

      As for the User define system, the closest I can think of is putting < > and / in the list of recognized operators, putting " and ' in the delimeters section, and adding whatever keywords you want to explicitly recognize in the various keyword sections.  You won't be able to get as specific highlighting, or the new tag highlighting as when using the xml language itself, though. 

    • Warren Tang

      Warren Tang - 2008-10-30

      In the View -> User Define Dialog I try to use
      to match the Folder Open, and to math the Folder Close I use

      but this won't achieve the two goals I am after.

      I have also read the following article but it lacks the details:

      Is this possible to match regular expressions?

    • Airdrik

      Airdrik - 2008-10-30

      The User define language system doesn't support regular expressions, unfortunately. 

      I wonder if it is insufficient to just switch the language to XML?

    • Warren Tang

      Warren Tang - 2008-10-31

      The XML cannot parse the file properly (e.g. the comments). So the User define system is unable to match <Directory "D:/PHP/Samples"/> in general, isn't it?