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
Deny from all
# viewed by Web clients.
Deny from 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.
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.
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?
The User define language system doesn't support regular expressions, unfortunately.
I wonder if it is insufficient to just switch the language to XML?
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?