You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
- You said "I am NOT interested in getting programs other than sed / grep / POSX extended REs to work." and then posted this answer using a program other than sed / grep / POSX extended REs.Ed Morton– Ed Morton2023-12-25 15:13:34 +00:00Commented Dec 25, 2023 at 15:13
- Yes, but this was just an illustratory / exemplary answer, AFTER I had reached the final conclusion "No, there is no built-in way in GLIBC POSIX or in GNU grep / sed REs to handle an even/odd number of escape characters properly" .JVD– JVD2023-12-26 18:02:20 +00:00Commented Dec 26, 2023 at 18:02
- After thinking about this for the last 3 days or so, I have reached the conclusion to develop a patch for both glibc and libc6 and grep and sed, that , for every POSIX character class, as a new GNU extension that can be enabled with the '/E' "Provide Escaped Char.Classes" modifier flag, will also provide an 'esc' suffixed variant of the char class that won't treat chars preceded by an ODD number of escapes as being part of the class, and maybe which will also have the sort of "number of elements test and conditional expression" logic described above.JVD– JVD2023-12-26 18:03:00 +00:00Commented Dec 26, 2023 at 18:03
- The PCRE answer is a non-answer to this specific question, but illustrates the sort of solution that would be acceptable, if only we could do something as simple or simpler in POSIX / grep / sed RegExps , but we can't.JVD– JVD2023-12-26 18:06:24 +00:00Commented Dec 26, 2023 at 18:06
- What's the point if you can already do whatever it is you want to do using perl? FWIW I still don't know what it is you're trying to do. If you provided sample input/output in your question that demonstrated all your requirements you may get an answer using existing POSIX tools and maybe it's not necessary to use a single regexp.Ed Morton– Ed Morton2023-12-26 18:07:58 +00:00Commented Dec 26, 2023 at 18:07
| Show 11 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. shell-script), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you