HTML + CSS Problem

HTML + CSS Problem

2
NewbieNewbie
2

    Jan 19, 2006#1

    I am a new user of UE 11, so forgive me if this is a stupid question. How can I configure UE to highlight the following syntax: <p class=standard> in an html document? Right now, "<p class=" is correctly highlighted, but I cannot figure out how to get the class name "standard" to also be highlighted. There must be something in the wordfile that I am missing, or else I am missing something in the syntax configuration dialog. Thanks for any help.

    20
    Basic UserBasic User
    20

      Jan 30, 2006#2

      I am not sure if there is support for RegExps in the word file but if so you could change class in to

      Code: Select all

      (?<=<[\w\s]*)(class){1}(\s*=\s*["']|=)([\w]*)((?=>)|(?= [^<]*?>)|["'](?=[^<]*?>))
      Which will highlight:
      - <span class=ClassName>
      - <span class="ClassName">
      - <img class=ClassName src="somepic.gif">

      RegEx Buddy Comments on the RegEx:

      // (?<=<[\w\s]*)(class){1}(\s*=\s*["']|=)([\w]*)((?=>)|(?= [^<]*?>)|["'](?=[^<]*?>))
      //
      // Assert that the regex below can be matched, with the match ending at this position (positive lookbehind) «(?<=<[\w\s]*)»
      // Match the character "<" literally «<»
      // Match a single character present in the list below «[\w\s]*»
      // Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*»
      // Match a single character that is a "word character" (letters, digits, etc.) «\w»
      // Match a single character that is a "whitespace character" (spaces, tabs, line breaks, etc.) «\s»
      // Match the regular expression below and capture its match into backreference number 1 «(class){1}»
      // Exactly 1 times «{1}»
      // Match the characters "class" literally «class»
      // Match the regular expression below and capture its match into backreference number 2 «(\s*=\s*["']|=)»
      // Match either the regular expression below (attempting the next alternative only if this one fails) «\s*=\s*["']»
      // Match a single character that is a "whitespace character" (spaces, tabs, line breaks, etc.) «\s*»
      // Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*»
      // Match the character "=" literally «=»
      // Match a single character that is a "whitespace character" (spaces, tabs, line breaks, etc.) «\s*»
      // Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*»
      // Match a single character present in the list ""'" «["']»
      // Or match regular expression number 2 below (the entire group fails if this one fails to match) «=»
      // Match the character "=" literally «=»
      // Match the regular expression below and capture its match into backreference number 3 «([\w]*)»
      // A word character (letters, digits, etc.) «[\w]*»
      // Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*»
      // Match the regular expression below and capture its match into backreference number 4 «((?=>)|(?= [^<]*?>)|["'](?=[^<]*?>))»
      // Match either the regular expression below (attempting the next alternative only if this one fails) «(?=>)»
      // Assert that the regex below can be matched, starting at this position (positive lookahead) «(?=>)»
      // Match the character ">" literally «>»
      // Or match regular expression number 2 below (attempting the next alternative only if this one fails) «(?= [^<]*?>)»
      // Assert that the regex below can be matched, starting at this position (positive lookahead) «(?= [^<]*?>)»
      // Match the character " " literally « »
      // Match any character that is not a "<" «[^<]*?»
      // Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
      // Match the character ">" literally «>»
      // Or match regular expression number 3 below (the entire group fails if this one fails to match) «["'](?=[^<]*?>)»
      // Match a single character present in the list ""'" «["']»
      // Assert that the regex below can be matched, starting at this position (positive lookahead) «(?=[^<]*?>)»
      // Match any character that is not a "<" «[^<]*?»
      // Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
      // Match the character ">" literally «>»
      A source of incoherent bullshit since 1986

      6,675585
      Grand MasterGrand Master
      6,675585

        Jan 30, 2006#3

        Regular expressions are not possible for syntax highlighting, only for the function list.

        Tomcain:
        You have to add all class names to a color group in the wordfile. You could create and use a macro to do this job if you often change the class names but want your class names always highlighted.
        Best regards from an UC/UE/UES for Windows user from Austria

        2
        NewbieNewbie
        2

          Jan 31, 2006#4

          Thanks, Mofi. I was hoping for a less tedious way to handle this, but, so be it. Re your suggestion for a macro, unfortunately I am not technical enough to write such a macro. Thanks for your help.