
Basic Regular Expression (BRE) is the default in sed (and similarly in grep). Historically this was a GNU extension, but the -E extension has since been added to the POSIX standard echo -e $'July 20th 2017, 11:03:37.620\tfc384c3d-9a75-459d-ba92-99069db0e7bf' | sed -E 's/^\s*July(.*)\t//' fc384c3d-9a75-459d-ba92-99069db0e7bfĪlso a simple read-up on Basic (BRE) and extended (ERE) regular expressionīasic and extended regular expressions are two variations on the syntax of the specified pattern. Extended regexps are those that egrep accepts they can be clearer because they usually have fewer backslashes. Use extended regular expressions rather than basic regular expressions. The regex is right, you are not trying sed with -regexp-extended

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
