BUG?? Syntax Highlighting Regular Expressions

I'm working on a rather long regular expression in
dreamweaver code view. It has about 200+ characters in it.
I wrote it in another application and copied it over for use
in js, and it wouldn't highlight correctly (sort of like when you
leave off quote on a string). Naturally I thought I screwed up my
regexp or forgot to escape a character or something so I went
through it re-writing it and checking everything but it was
correct. I saved the page and ran it in the browser and sure enough
it worked.
So I started typing the regexp from scratch this time in
dreamweaver to see when it stopped highlighting correctly. It
stopped at exactly 100 characters including opening and closing
forward slashes. I tried writing another exp this time filled with
just one letter. Again 100 characters exactly - not one more.
Example:
var reg1 =
/ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss ssssssssss/
var reg2 =
/ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss sssssssssss/
reg1 will highlight correctly, while reg2 won't.
Is this a bug or am I missing something? The highlight rule
(in Configuration\CodeColoring\CodeColoring.xml) is
(\s*/\e*\\/
-or-
=\s*/ \e*\\ /
There seems to be no limitation to length there.
While this is not a huge deal, I might as was well be coding
in notepad (or my other script editors which highlight this
correctly) because the highlighting is worthless from this point
on.
I could make these strings instead of literals but I have a
lot of these long expressions and would rather not go through them
and escape all of my back slashes (there are tons) as well as
quotes - and make them more un-maintainable as they already are.
Anyone have this problem? Or a solution to it?

random_acts wrote:
> I'm working on a rather long regular expression in
dreamweaver code view. It
> has about 200+ characters in it.
I have never written a regex as long as that, but was
fascinated by your
question, so attempted to replicate your problem.
I gave up at 614 characters, but the syntax coloring didn't.
I suggest
that you submit a bug report with the details of your actual
code:
http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/

Similar Messages

  • [CC] Search&Replace: Bug only with Regular Expressions

    Can you confirm the following behaviour/bug?
    Steps to reproduce:
    1 Create a new document in DW CC
    2 Enter that text in the source code view:
    <p>&euro;</p>
    3 Open Search&Replace
    Field Search in: Current document
    Field Search: Text
    Field Search (3rd Field): €
    Start Search
    Result: As expected the "€" is found.
    4 [x] Regular Expressions
    Start Search
    Result: "€" isn't found
    Can you reproduce that?
    Do you regard that as a bug like me?
    If not, why please?
    Do you think it is technically impossible for the developers to solve the task?
    Do you think the developers forgot to gray out "text" in the choice box and allow regular expressions only in source code?
    Thanks.

    Nice that you like the nick
    Sure, I know that I can file a feature wish.
    But my main interest in this forum is to know, what other users think about certain features, why they think so, which they miss, which they regard as a bug, ...
    When I remember it right, you told me some time ago, that you don't use RegEx.
    Than I understand, that everything around that feature is not important for you.
    What I like to understand is, why you think the behaviour is logically.
    For me it is the opposite.
    You get a result with "Scope: Text", "[ ]RegEx".
    And you get no result with "Scope: Text", "[x]RegEx".
    Incredible strange.
    I would appreciate, if you could explain more detailed your view.

  • Bug in ExtendScript regular expressions

    I don't know if this is a problem with javascript in general or photoshop's hosting of it.  The bug reporting area looks dicey so I'm posting it here too.
    This expression: "a_bs".match(/^\s*(A)(?:_B|_BS)?\s*$/i)
    Evaluates to: a_bs,
    That is it fails to report the grouped (a) up there.  Obviously I'm using it in a more complex manner (a bunch of |s inside the first group).
    The following works as I'd expect.
    This expression: "a_bs".match(/^\s*((A)(?:_B|_BS)?)\s*$/i)
    Evaluates to: a_bs,a_bs,a
    It DOES pick up the a in its group.  Both ruby and python agree with me.  If anyone from Adobe is listening, please fix it.
    Thanks,
    Adrian

    Each rev fixes some RegExp bugs and introduces new ones. It's tedious but do report your bugs at adobe.com. The have fixed some of mine.
    Also, sometimes ESTK and PS have different bugs.

  • Bugs in the REGULAR EXPRESSIONS ORACLE10g

    Hi....
    In the next URL http://otn.oracle.com/oramag/webcolumns/2003/techarticles/rischert_regexp_pt1.html
    Have a next title Writing More Complex Patterns , and the code is :
    SELECT REGEXP_INSTR('Joe Smith, 10045 Berry Lane, San Joseph, CA 91234-1234',
    ' [[:digit:]]{5}(-[[:digit:]]{4})?$')
    AS starts_at
    FROM dual
    I see this code in the Table 7 in the URL
    http://otn.oracle.com/oramag/webcolumns/2003/techarticles/rischert_regexp_pt2.html#t7
    But , the explanation of the code have a error in the pocket number 11 ..
    Say :
    [:digit] POSIX [:digit] class
    [ Start of character list[/b]
    ] End of character list
    {4} Repeat exactly four ocurrences of the character list
    it would be to say :
    [:digit] POSIX [:digit] class
    ] End of character list
    {4} Repeat exactly four ocurrences of the character list
    it has more than enough the line 11
    Regards
    Hector Gabriel Ulloa Ligarius
    PD : Sorry my english

    Thanks for pointing this out...the error has been corrected.

  • Regular Expressions for textfield syntax checking while typing?

    Hi all,
    my application has a textfield for entering customer numbers. The customer numbers have a certain syntax which I want to have checked while the user types.
    According to our company's style guide, the textfield's background color has to be
    - RED in case of an error,
    - WHITE in case of correct input,
    - YELLOW when the input is incomplete but the beginning is correct.
    To check the syntax with Regular Expressions is easy for the WHITE and RED cases. But I'm struggling with the YELLOW case.
    public static boolean checkTest(String s) {
         String regExp = "(\\d{6,8},\\d{1,3},\\d{1,3},\\d{1,2})";
         return Pattern.matches(regExp, s);
    }The above method returns true for the following examples:
    "12345678,1,2,3"
    "123456,11,22,33"
    "1234567,123,123,12"
    I now need another method which returns true if the user entered a valid beginning, for example:
    "123"
    "1234567,"
    "123456,123,1"
    Any ideas? I would be glad to get this done...

    @notivago
    In the meantime I also came up with a pattern to
    check the YELLOW case:
    String partly =
    "\\d{0,8},?|\\d{6,8},\\d{0,3},?|\\d{6,8},\\d{1,3},\\d{
    0,3},?|\\d{6,8},\\d{1,3},\\d{1,3},\\d{0,2}";Sounds good to me.
    It seems to work. But my actual goal is to do such
    color-coded syntax checking for other number types
    (other patterns) as well. And it should be easy to
    add or change number types.I cant figure how to do that for now.
    So it would be nice to have a generic way to generate
    the YELLOW-pattern from the other one. Is it
    possible? Probably, but I cannot come up with any idea now.
    Is there a better solution than my one
    ("String partly" above)? Something I can just append
    to the original pattern for example?There are others, but it is hard to say what would be better or worse.

  • Extracting text from a file name on export / import (Regular Expressions??)

    I’m not even sure if the publishing service, File Naming, in Lightroom supports Regular Expressions or not?? Basically I’m trying to extract the left portion of the file name ie: everything before the underscore “_”. When I import a file I rename the file to reflect the current Image sequence number and then append the date the photo was taken; a typical file is as follows “05625_2008-01-05.dng” on export I would like the new name to be only the sequence number in this case “05625.jpg”. Ideally I would then like to append the folder name that contains the file… “05625 - FolderName.jpg.
    I don’t want to go down the road of figuring out the correct syntax if regular expressions aren’t supported. Thanks in advance - CES

    Is the imported sequence number captured in meta data somewhere or is their somewhere that all of the available fields and there reference names can be found???
    Unfortunately not anywhere available to the user (but it's still stored in at least some filed I know off).
    By the way, why did you choose to put the suffix at the beginning of the name (1234_2010-08-13.jpg)? The common practice is to leave the suffix at the end. That will ensure the filenames will sort in chronological order by filename and you could have easily used the suffix when exporting files. You wouldn't have this problem now.

  • Sed Request Regular Expression Format

    A quick question....
    There are lots of different syntaxes for regular expressions and lots for SED. With the sed_request and sed_response filter I have tried different syntaxes for marking word boundaries, but don't know which to use. The \b syntax is supported but doesn't seem to do anything and the \< and \> syntax throughs up errors when I start up the web server. I tried the more complex (?<!\w)(?=\w) and (?<=\w)(?!\w) but the \w isn't supported. I am wondering if I just can't do this.... I am trying to stop SQL injection attacks using a syntax such as
    s/\bselect\b.{1,100}?\bfrom\b.{1,100}?\bwhere\b//g
    Are word boundaries not supported?

    Actually, the entries should be \\< and \\>, which looks double escaped to me but the entries are correct then
    Input fn="insert-filter"
    method="(GET|HEAD|POST)"
    filter="sed-request"
    sed="s/</\\</g"
    sed="s/%3c/\\</g"
    sed="s/%3C/\\</g"
    sed="s/>/\\>/g"
    sed="s/%3e/\\>/g"
    sed="s/%3E/\\>/g"
    sed="s/\x3C ?iframe//g"
    sed="s/\\<src\\>[^a-zA-Z_0-9]*?\\<javascript://g"
    sed="s/\\<src\\>[^a-zA-Z_0-9]*?\\<vbscript://g"
    sed="s/\\<href\\>[^a-zA-Z_0-9]*?\\<javascript://g"
    sed="s/\\<alert\\>[^a-zA-Z_0-9]*?\x28//g"
    sed="s/\\<src\\>[^a-zA-Z_0-9]*?\\<http://g"
    sed="s/\\<type\\>[^a-zA-Z_0-9]*?\\<text\\>[^a-zA-Z_0-9]*?\\<vbscript\\>//g"
    sed="s/\\<href\\>[^a-zA-Z_0-9]*?\\<vbscript://g"
    sed="s/\\<url\\>[^a-zA-Z_0-9]*?\\<javascript://g"
    sed="s/\x3C ?script\\>//g"
    sed="s/\\<type\\>[^a-zA-Z_0-9]*?\\<text\\>[^a-zA-Z_0-9]*?\\<javascript\\>//g"
    sed="s/\\<url\\>[^a-zA-Z_0-9]*?\\<vbscript://g"
    sed="s/(asfunction|javascript|vbscript|data|mocha|livescript)://g"
    sed="s/(?i:<object[ /+\t].*?((type)|(codetype)|(classid)|(code)|(data))[ /+\t]*=)//g"
    sed="s/(?i:[ /+\t\"\'`]datasrc[ +\t]*?=.)//g"
    sed="s/(?i:<link[ /+\t].*?href[ /+\t]*=)//g"
    sed="s/(?i:<meta[ /+\t].*?http-equiv[ /+\t]*=)//g"
    sed="s/(?i:<embed[ /+\t].*?SRC.*?=)//g"
    sed="s/(?i:[ /+\t\"\'`]on\x63\x63\x63+?[ +\t]*?=.)//g"
    sed="s/(?i:<?frame.*?[ /+\t]*?src[ /+\t]*=)//g"
    sed="s/(?i:<isindex[ /+\t>])//g"
    sed="s/(?i:<form.*?>)//g"
    sed="s/(?i:<script.*?[ /+\t]*?src[ /+\t]*=)//g"
    sed="s/(?i:<script.*?>)//g"
    sed="s/\\<select\\>.{0,40}buser\\>//g"
    sed="s/\\<select\\>.{0,40}\\<substring\\>//g"
    sed="s/\\<select\\>.{0,40}\\<ascii\\>//g"
    sed="s/\\<user_tables\\>//g"
    sed="s/\\<user_tab_columns\\>//g"
    sed="s/\\<all_objects\\>//g"
    sed="s/\\<drop\\>//g"
    sed="s/\\<substr\\>//g"
    sed="s/\\<sysdba\\>//g"
    sed="s/\\<user_password\\>//g"
    sed="s/\\<user_users\\>//g"
    sed="s/\\<user_constraints\\>//g"
    sed="s/\\<column_name\\>//g"
    sed="s/\\<substring\\>//g"
    sed="s/\\<object_type\\>//g"
    sed="s/\\<object_id\\>//g"
    sed="s/\\<user_ind_columns\\>//g"
    sed="s/\\<column_id\\>//g"
    sed="s/\\<table_name\\>//g"
    sed="s/\\<object_name\\>//g"
    sed="s/\\<rownum\\>//g"
    sed="s/\\<user_group\\>//g"
    sed="s/\\<utl_http\\>//g"
    sed="s/\\<select\\>.*?\\<to_number\\>//g"
    sed="s/\\<group\\>.*\\<byb.{1,100}?\\<having\\>//g"
    sed="s/\\<select\\>.*?\\<data_type\\>//g"
    sed="s/\\<isnull\\>[^a-zA-Z_0-9]*?\x28//g"
    sed="s/\\<union\\>.{1,100}?\\<select\\>//g"
    sed="s/\\<insert\\>[^a-zA-Z_0-9]*?\\<into\\>//g"
    sed="s/\\<select\\>.{1,100}?\\<count\\>.{1,100}?\\<from\\>//g"
    sed="s/\x3B[^a-zA-Z_0-9]*?\\<drop\\>//g"
    sed="s/\\<select\\>.*?\\<to_char\\>//g"
    sed="s/\\<dbms_java\\>//g"
    sed="s/\\<nvarchar\\>//g"
    sed="s/\\<utl_file\\>//g"
    sed="s/\\<inner\\>[^a-zA-Z_0-9]*?\\<join\\>//g"
    sed="s/\\<select\\>.{1,100}?\\<from\\>.{1,100}?\\<where\\>//g"
    sed="s/\\<intob[^a-zA-Z_0-9]*?\\<dumpfile\\>//g"
    sed="s/\\<delete\\>[^a-zA-Z_0-9]*?\\<from\\>//g"
    sed="s/\x3B[^a-zA-Z_0-9]*?\\<shutdown\\>//g"
    sed="s/\\<dba_users\\>//g"
    sed="s/\\<select\\>.{1,100}?\\<top\\>.{1,100}?\\<from\\>//g"

  • Bug in ExtendScript's regular expression engine

    I'm using ExtendScript 3.92.115, and I'm noticing that a certain regular expressions don't work properly.  I've tried the same expressions on popular browsers, and they work fine.  Here's an example:
    alert('ab'.match(/(.)(?:.*?)$/));
    The alert should display the array: ["ab", "a"], because there is a match ("ab"), and one capturing group ("(.)" captures "a").  Instead it displays ["ab", undefined], which makes no sense.  It works fine if both groups are capturing: "(.)(.*?)$", if you remove the non-greedy modifier: "(.)(?:.*)$", or even if you don't group the second part: "(.).*?$".
    Any thoughts?  I can modify my regular expressions to work around these problems, but it'd be good to fix the engine if it's really broken, as I suspect.
    Thanks!

    Each rev fixes some RegExp bugs and introduces new ones. It's tedious but do report your bugs at adobe.com. The have fixed some of mine.
    Also, sometimes ESTK and PS have different bugs.

  • Find text using regular expression and add highlight annotation

    Hi Friends
                       Is it possible to find text using regular expression and add highlight annotation using plugin

    A plugin can use the PDWordFinder to get a list of the words on a page, and their location. That's all that the API offers for searching. Of course, you can use a regular expression library to work with that word list.

  • FM9 SDL Authoring Assitant Regular Expression Syntax?

    I'm trying to trick SDL into identifying words that are not approved by STE.
    Under "Configure|Style and Linguistic Checks|User Defined Rules" the program allows regular expressions to create custom rules.
    I have all other options in the Utility unchecked.
    I am by no means a pro at regular expressions but was able to create a pretty solid command at http://regexlib.com/RETester.aspx.
    The idea is to create an expression that looks for any word other than those seperated by vertical bars.
    For the test text "this is not the way that should work. this is not the way that should work."
    \b(?:(?!should|not|way|this|is|that).)+
    returns: the work the work
    At that website, I can change the excluded words and it works every time. Change the test text, same thing, still works.
    Perfect! I ripped every approved word in STE into the formula and it (SDL) only returns words at the end of the sentence that are followed by a periods and question marks. So I added"\." to the exclusion list in the expression and it only found words next to question marks. I excluded question marks and now it finds nothing. I don't understand this as I wasn't aware that I had any criteria in the expression that dictates functionality only at the end of the sentence.
    I have an O'reilly book to refer to, if anyone can give me a shove in the right direction as to which set of rules to adhere to, I would appreciate it. Why did negative word matching have to be my introduction to this subject?

    I tried your expression in a couple of regex tools and it seems to parse as you wanted it to. I suspect that the SDL implementation doesn't follow the unix/linux standards. I haven't used the tool and the usage documentation is non-existant, except for the limited flash-based demo.
    From the SDL knowledgebase, it states that their regex filter uses the .NET regex flavour and I believe that the differences on this are explained in the "Mastering Regular Expressions" book.

  • ALC-FUT-001-007: Syntax error in the regular expression *. from File Utilities - Find in ES2

    Has anyone encountered the above error when trying to use the Foundation - File Utilities service Find?
    This is occuring in ES2, and I have tried using an asterisk, as well as the exact file name I know exists.
    I have tried literals in the Process Properties, as well as passing it in via string variables.
    Any help is appreciated.
    Thanks
    Mark

    Thanks for your response.
    Here is what we have learned:
    We should not put the regular expression value in single quotes - eliminates the error.
    The problem is, the Find operation always returns an empty list no matter what criteria we enter - even C:\ with criteria = *.*
    ES 2 is running on a Windows 2003 machine.
    Thanks Again
    Mark

  • Regular expressions and back references

    Just wanted to know if anyone else noticed that.
    In the javadoc of java.util.regex.Pattern in the "Back references" section it says that you need to use \n to match capturing group but it does not work. To match a capturing group one need to use a "$" sign which is not standard for this type of operation.
    For example, the following code should work according to the API and most other regular expression engines:
    Pattern.compile("([A-Z])").matcher("ThisIsATestString").replaceAll(" \1");
    But to make this work you need to use:
    Pattern.compile("([A-Z])").matcher("ThisIsATestString").replaceAll(" $1");
    So, is this just a doc bug or am I missing something?
    Someone have any idea why Sun choose to use the "$" sign instead of the regular "\" sign??
    TIA,
    Shaul

    The doc you're referring to is talking about using back-refereneces within the regex, not in the replacement string. For instance, if you wanted to find all instances of things like "foo-foo" or "bar-bar", you would use a Pattern like   Pattern p = Pattern.compile("([a-z]+)-\\1");For the most part, they've made the syntax the same a Perl's regexes, and that's why they use $n instead of \n in the replacement string. The replacement string is described in the Matcher javadoc.

  • Nano syntax highlighting: catch-all syntax for configuration files

    After years of using nano, I only recently learned that it supports syntax coloring... (Why would they turn that off by default? ) Well, I thought I'll make up for it by making extra good use of it from now on...
    Unfortunately it didn't ship a highlighting syntax for the the kind of files that I use nano the most for: system configuration files.
    So I wrote my own, and after tweaking a bit here and there whenever I encountered a config file for which the highlighting wasn't satisfactory at first, I think the result is now good enough (screenshots below) that it's worth sharing with my fellow Arch users:
    Code & Instructions:
    Here is the syntax definition:
    # config file highlighting
    syntax "conf" "(\.(conf|config|cfg|cnf|rc|lst|list|defs|ini|desktop|mime|types|preset|cache|seat|service|htaccess)$|(^|/)(\w*crontab|mirrorlist|group|hosts|passwd|rpc|netconfig|shadow|fstab|inittab|inputrc|protocols|sudoers)$|conf.d/|.config/)"
    # default text
    color magenta "^.*$"
    # special values
    icolor brightblue "(^|\s|=)(default|true|false|on|off|yes|no)(\s|$)"
    # keys
    icolor cyan "^\s*(set\s+)?[A-Z0-9_\/\.\%\@+-]+\s*([:]|\>)"
    # commands
    color blue "^\s*set\s+\<"
    # punctuation
    color blue "[.]"
    # numbers
    color red "(^|\s|[[/:|<>(){}=,]|\])[-+]?[0-9](\.?[0-9])*%?($|\>)"
    # keys
    icolor cyan "^\s*(\$if )?([A-Z0-9_\/\.\%\@+-]|\s)+="
    # punctuation
    color blue "/"
    color brightwhite "(\]|[()<>[{},;:=])"
    color brightwhite "(^|\[|\{|\:)\s*-(\s|$)"
    # section headings
    icolor brightyellow "^\s*(\[([A-Z0-9_\.-]|\s)+\])+\s*$"
    color brightcyan "^\s*((Sub)?Section\s*(=|\>)|End(Sub)?Section\s*$)"
    color brightcyan "^\s*\$(end)?if(\s|$)"
    # URLs
    icolor green "\b(([A-Z]+://|www[.])[A-Z0-9/:#?&$=_\.\-]+)(\b|$| )"
    # XML-like tags
    icolor brightcyan "</?\w+((\s*\w+\s*=)?\s*("[^"]*"|'[^']*'|!?[A-Z0-9_:/]))*(\s*/)?>"
    # strings
    color yellow "\"(\\.|[^"])*\"" "'(\\.|[^'])*'"
    # comments
    color white "#.*$"
    color blue "^\s*##.*$"
    color white "^;.*$"
    color white start="<!--" end="-->"
    To install, save the above above code snippet as a file called conf.nanorc in the folder /usr/share/nano/ (or /usr/local/share/nano/ or similar if you feel strongly about the /usr <--> /usr/local separation), and then add the following to the end of the file /etc/nanorc:
    ## Configuration files (catch-all syntax)
    include "/usr/share/nano/conf.nanorc"
    Hints:
    The colors I chose look good (imo) with the terminal background and color settings that I use, but might not look good, or even readable, with yours, so simply change the color names in the code snippet to whatever you prefer - valid color names are:
    If you use a console with white background, you'll have to change at least the white color I chose for comments and punctuation.
    The first code line in the snippet includes a regular expression that defines for which file names this syntax highlighting should be used. Whenever you encounter a config file that is not matched by this, but you would still like to open it with syntax highlighting, you can manually select this syntax with nano's -Y switch, like so:
    nano -Y conf myConfigFile
    Technical Note:
    It's implemented as a single catch-all syntax, since nano chooses which syntax to apply based on the filename, and in the case of config files usually not much can be learned about the content format from the file name extension (.conf can by anything from flat key/value tuples to XML, .ini can be the official INI format or something else, etc...).
    This means that some compromises have been made, so with this highlighting syntax probably no config file looks 100% as good as a highlighting syntax that would be specifically optimized for one kind of config format, but all in all the vast majority of config files should look pretty good.
    Screenshots:
    /etc/rc.conf,  /etc/hosts:
    /etc/pacman.conf,  /etc/group:
    xorg.conf,  some .desktop file:
    httpd.conf (Apache config),  php.ini:
    More screenshots:
    /etc/fonts/fonts.conf (uses XML)
    /etc/inittab
    /etc/fstab
    /etc/inputrc
    /etc/mime.types
    /etc/protocols
    /etc/xinetd.conf
    See Also:
    nano syntax highlighting: GNU makefiles
    Update [2012-01-28]: Made some more improvements to the syntax definition (see post)
    Last edited by sas (2012-02-01 15:26:43)

    doug piston wrote:I deal with alot of .mk files and would love to see it there.
    You mean GNU makefiles?
    I'm afraid they might be out of scope for this generic config-file syntax.
    Logically they're not system config files, and technically they're a pretty specialized and complex format (different "types" of rules, rules spanning multiple lines, rules containing arbitrary Bash code, etc.).
    This is how an .mk file currently looks with this highlighting syntax:
    $ nano -Y conf /usr/lib/httpd/build/rules.mk
    And apart from highlighting variables of the form $$abc or $(abc), I'm not sure how much can be improved here without breaking the highlighting for more conventional config files.
    It would probably be better to create a specialized highlighting syntax just for .mk files.
    EDIT: I sat down and did just that, here's the result: nano syntax highlighting: GNU makefiles, and here is how the above makefile snipped looks with it:
    Last edited by sas (2012-02-01 15:18:52)

  • Repainting question for my syntax highlighter

    Hello there,
    I have a syntax highlighter which reuses much of the very useful code developed by Claude Dugauy, which can be found at http://www.fawcette.com/javapro/2003_07/magazine/columns/visualcomponents/default_pf.aspx
    . The syntax highlighting uses regular expressions, so its easily extendable to meet your needs.
    However, there is one problem: whenever the user presses a key, the whole of the TextPane containing the highlighted text, is repainted in its entirety. This is fine for small amounts of text to be highlighted, but is very slow when it comes to 1000+ lines.
    Please could someone be so excellent as to tell me how to go about addressing this problem, so that only a small amount of text is repainted whenever the user types something into the TextPane e.g. that inside the current viewport, or just the last typed word - thus removing this problem of inefficiency.
    Thanks in advance,
    Edd.

    I don't think it's going to be that easy. Every time a change is made, the default style is applied to the whole document, then the whole document is copied into a String so it can be reparsed and have the syntax styles applied again. Even if you could limit what actually gets painted, you'd still have all that unnecessary work going on.
    You could try forcing the highlighter to only reparse a portion of the document--like,say, a hundred lines before and after the point where the edit occurred--but deciding exactly where to start and stop can be pretty tricky.

  • Need help with regular expression

    I'm trying to use the java.util.regex package to extract URLs from html files.
    The URLs that I am interested in extracting from the HTML look like the following:
    <font color="#008000">http://forum.java.sun.com -
    So, the URL is always preceeded by:
    <font color="#008000">
    and then followed by a space character and then a hyphen character. I want to be able to put all these URLs in a Vector object. This doesn't seem like it should be too difficult but for some reason I can't get anywhere with it. Any help would be greatly appreciated. Thanks!

    hi gupta am not sure of the java syntax but i can tell u about the regular expression...try this....
    <font color="#008000">(http:\/\/[a-zA-Z0-9.]+) [-]
    i dont know the java methods to call...just the reg exp...
    Sanjay Acharya

Maybe you are looking for

  • Error while sending a soap request from XML SPY to a webservice in XI

    Hi , I published a webservice om the XI end and testing it with consuming the WSDL file in XML SPY and sending a soap request from there. I am getting the following error . <b>com.sap.aii.af.mp.module.ModuleException: either no channelID specified or

  • No Network given for transaction 0020

    While posting invoice (tcode MIRO) against PO, i am having error "No Network Given for transaction 0020". The PO is having account assignment "N" Network and 0020 is the activity number. Any idea how to resolve this. Regards, Shahzad Shakoor

  • Message No F5808 Field Assign. is a required field for G/L Account.

    Hi Guys, I have a problem when releasing a cancel credit memo billing document. It shows the following error message: Field Assign. is a required field for G/L Account. Message No. F5808 Diagnosis, The value field "Assign." in the interface to Financ

  • HP 2320 network printer keeps dropping off network

    I have a small home network, running off a current gen TimeCapsule. I have an HP Colorlaser CM2320 network laser printer connected to a 5-port switch on the network. Randomly, the printer disappears. When selected in a print dialog, the satus is offl

  • Using window.alert in a jsp file

    I am creating a website, when a user is found invalid I want to display an alert. The code is below     if( invalid )          window.alert( "Invalide user" );          response.sendRedirect( "login.jsp" );    }  The problem is that window.alert is n