Jump to content
Xtreme .Net Talk

Richard Crist

Avatar/Signature
  • Posts

    97
  • Joined

  • Last visited

Everything posted by Richard Crist

  1. mark007, As I mentioned in my reply to marble_eater, I think that I will also have to use your keypress idea as I will not only be displaying static text, but editable text in addition. Your ideas of control switching may come in handy. I will experiment and get back. Thank you! :)
  2. I've searched the forum but can't seem to find information about textbox character wrapping. I need to be able to have a textbox control that character wraps instead of word wraps. That is, when the textbox displays the text it wraps the text on a character boundary, not a word boundary. I must display EDI X12 data at work and word wrapping can be very misleading. I've found precious little on the web (either MSDN or Google) about .NET textbox character wrapping. Can someone point me in the right direction if I need to code a custom inheritable textbox control to do this? I'm not yet hip to the base methods I would need to mess with, maybe paint or draw or display or something? Surely someone else has wanted or needed to characater wrap instead of word wrap a text box. :eek: Thank you for any and all help! :)
  3. Nobody touch nobody Uhm....hey marble_eater.....check out my portion of the post in the top thread of this post. :)
  4. You guys are out of control LOL :D This forum has some of the best funny moments. I'm sorry I didn't check out the random thoughts earlier. :)
  5. Wow Wow....this is a really cool question, and since no one has commented on it yet I'll take a stab at. Perhaps my answers or others that reply will help out the regex community, because I think this is a good application of regex's. Setup: * Application needs to decide what to do with a file based on file extension * Lots of different file extensions being encountered * Some are fixed and most others fit some pattern, e.g., *.R* for RAR files * Very cumbersome to try and handle each possible extension individually My comments: * I'll assume (and you know what that does) that using patterns will greatly reduce the number of extension entries to be tracked. For example, the pattern \.R[0-9]0-9]$ matches all file extensions .R00 through .R99, reducing the count for that file extension tracking from 100 entries to 1 entry. * Based on that assumption I believe that you will be able to negate the need for a hash table or use the hash table more judiciously. Perhaps you could store fixed extensions in the hash table. By fixed I mean ".avi", ".txt", etc. You could check the extension against the hash table and if found then you're done. If you don't find the extension in the hash table, then you can start comparing it against a sequential list of regex patterns. * This is where it gets subjective. The list of regex patterns probably won't be that big, but even if it is you will most likely still want to go through all the entries. Since a given extension has the potential to match more than one extension pattern, you may have to come up with a resolution method. You might want to check the extension against all extension patterns, and if more than one match is found then do some more extensive extension analysis (no pun intended). * At this point in the discussion there is room for thinking about potentially how many different regex patterns you might handle. If it's a lot, then you might want to hash the patterns into a seperate table, based on the first character of the extension. This and other considerations will have to be made upon analysis of the actual application environment currently and/or as it progresses. That's my ideas. I'm sure that others have suggestions that can help us all think and learn more. :) Regular Expression Documentation
  6. I'm not happy I finally found the answer in the Visual Studio documentation - and I'm not happy. In their infinite wisdom they have decided to use the Communist approach and assume that everyone should edit the same way. See help information below:
  7. Ah, man Well....I checked out the thingy and it's an entry in the registry notifying VS .NET about additional file types. I've posted a new reply at the top level about information I FINALLY found in the VS .NET help (probably via the MSDN library). Thanks for trying on my behalf, though. :)
  8. Rofl You guys are insane!!! You just made my morning! :D
  9. Thank you and stuff You are the man. :cool: I have downloaded the VS .NET 2003 file. I will edit it and see what it does and see if I can use the technique to create my own syntax stuff. Thanks again! :)
  10. Why can't I just get on with things? I'm always wanting to do esoteric things that sometimes lead to coolness, other times lead to usefulness, and sometimes just lead to embarassment. :o I'm still waiting on someone to stumble on a way to make personal syntax lists in the VS .NET editor. If someone found a way I would say "Thank you" and stuff. :)
  11. Regex!! Yes, if you have a string and you want to check each word then you would have to parse the words out to check them. And to determine vowel frequency maybe we could check the values in the Scrabble game? :p I appreciate everyone's posts in this regex forum. I have learned a lot about .NET regex while trying to find answers to questions posted. :)
  12. .NET to the rescue!? seve7_wa's response got me to thinking. I investigated the .NET regex documentation. I came up with the following one line piece of code below that (I think) does what you want: bool vowel_check = Regex.IsMatch(input_string, "a") && Regex.IsMatch(input_string, "e") && Regex.IsMatch(input_string, "i") && Regex.IsMatch(input_string, "o") && Regex.IsMatch(input_string, "u") The above statement (in C#, modify for your language of choice) will return true only if all the vowels are found in the input_string. It takes the five IsMatch boolean return values and "ands" them together. Only if all are true will the result be true. Try it out and let us know how it works. :)
  13. Example(s)
  14. If I understand If I understand your goal correctly: * you have a list of words to be highlighted * for each word in the list you will search for the word in another text area that contains no HTML attributes to start with * each time you find a word you want to highlight it with <b></b> If this is correct then I propose the following: For a given word "testword" search for ([^>])(testword)([^<]) replace with \1<b>\2\</b>\3 This says find "testword" where it does not have a ">" before and does not have a "<" after (meaning it is not surrounded by an HTML attribute), using parentheses to refer back to the search result in an ordinal manner. Then replace the found text, inserting the bold start and bold end HTML attribute at the proper positions. Doing this for each word in the word list will work ok because as you search you are ignoring any candidate results that already have HTML around them. I hope that I understand your question and that this answer helps in some way. :)
  15. Maybe I may be making this too simple, but here's my suggestion: To change "<%@ TagName="SourceCtrl" ABC=""6876786""%>" to "<%@ TagName=<font color="orange">"SourceCtrl"</font> ABC=<font color="orange">""6876786""</font>%>" use the following: Search for (TagName\=) replace with \1<font color="orange"> Search for ( ABC=) replace with </font>\1<font color="orange"> Search for (\%\&gt\;) replace with </font>\1 Please reply if I'm off the mark, which I'm reasonably sure that I am. :p
  16. Correction / Additional Information The last reply I posted was correct except for my word translation of the regular expression. It should read as follows (one line added before the end): zero or more non-digit characters followed by a 6 digit number followed by 1 or more non-digit characters followed by a 6 digit number followed by zero or more non-digit characters Hope I didn't confuse anyone too much the first time. :p Also if you wanted to search for lines with just one 6 digit number you could use: \D*(\d{6})\D* And if you wanted to search for lines with either one OR two 6 digit numbers you could "OR" them together using the vertical bar (pipe) character "|" as follows: \D*(\d{6})\D*|\D*(\d{6})\D+(\d{6})\D* Regular expression bonanza can be found here. :)
  17. Excellent feedback! Thank you both, stustarz and Nerseus, for your quick replies and good information. Based on what you have said I have confidence that I can install Visual C++ 6.0 without interfering with my current VS .NET 2003 installation. If I have any problems I will reply with my results, otherwise thank you both very much! :cool:
  18. Hey all! For reasons that I can go into if anyone really wants to know, I need to ask a compatibility question. Current situation: I have full-blown Visual Studio .NET 2003 with all languages installed on my pc. Desired situation: I want to install as a totally separate entity Visual C++ 6.0 Question: Can Visual Studio .NET 2003 and Visual C++ 6.0 exist as totally separate environments, or will the C++ versions in .NET versus plain C++ 6.0 conflict? :confused:
  19. Possible solution for your dropdown list Well...I imagine you've got a drop down list that's populated with the word "Select a dog breed" or something like that at the top to direct users what to do. If that is the case, and you know what the directive message is, i.e. "Select a dog breed", then in the dropdown_changed event handler for that control I would just check for the directive message and do nothing if the "Select a dog breed" message is the text value. Does this make sense? Another alternative is to have the control label direct the user what to do, and have an empty entry as the top choice in the drop down list. You could then just check for non-emptiness in the event handler. :)
  20. Let's try again Try the expression below. I've tested it in my homemade .NET regular expression tester and it seems to work. ([ \t\r\n][A-Z]+[A-Z0-9\-]*[0-9]+[A-Z0-9\-]*[ \t\r\n])|([ \t\r\n][0-9]+[A-Z0-9\-]*[A-Z]+[A-Z0-9\-]*[ \t\r\n]) I'm tired now. :p
  21. I know what you mean I've had this issue before and it's might near impossible to do. One thing you can do is find lines that contain "select" and exclude them from processing. For example, if you were reading a file or stream that is broken into separate lines you could test each line to see if it contains "select" and only process the ones that fail the test. Maybe this helps. :-\
  22. Complex I'm still looking into your question, but at first pass my answer is that it will be difficult to find a regular expression that will find all five vowels in any order with one expression. There are 5 vowels, aeiou, and if you arrange them in all possible orders that would be a permutation of 5 things taken 5 at a time. That amounts to 120 possible unique orderings of the 5 vowels. You could use the expression below: [aeiou].*[aeiou].*[aeiou].*[aeiou].*[aeiou] but that will also find "aaaaa", "aaaoo", and so forth. You could use the one below: [a].*[e].*.*[o].* but that finds one unique permutation, and there are 120 unique permutations. Right now I can't think of one regular expression that will find all five vowels in any order. If I think of or stumble across one I will reply. Perhaps someone else has somethoughts on this? :confused:
  23. Excellent Now you're making sense. :cool:
×
×
  • Create New...