String test = new string(new char ", test, i, And if someone is only concerned with ASCII, then they only need to know about "_". As for the additional characters included in \w, the documentation is not explicit, so here's a program that shows the UTF8 characters in \w that are not in. In the end, the user will be obliged to validate whatever advice he receives. That is another kind of help that is just as useful as I believe mine to be. Your style seems to be directly craft the pattern to the sample data. That's the kind of help I try to provide. I try to write patterns matching what you want and excluding what you don't want. If he wanted "_", wouldn't he have provided one in the original example? Maybe the OP really does want "_", but if so maybe he should say so rather than giving a pattern that says he doesn't. It's just that the OP started with letters, digits and dash, but \w also includes "_", so your pattern changed the original request. John Grove - TFD Group, Senior Software Engineer, EI Division, String pattern = rx = new Regex(pattern, RegexOptions.IgnoreCase) įailed: 1-2-3-3-4-3 Failed: -abc def 123 Failed: abc -def 123 Failed: abc def 123
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |