Timeline for Sed command that would ignore any commented match
Current License: CC BY-SA 3.0
15 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 23, 2017 at 12:40 | history | edited | CommunityBot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
| Jul 21, 2016 at 11:34 | history | edited | don_crissti |
edited tags
|
|
| Apr 13, 2015 at 7:32 | history | edited | Vrakfall | CC BY-SA 3.0 |
deleted 1 character in body
|
| Apr 10, 2015 at 15:32 | comment | added | mikeserv | @richard - regular expressions of the pure, mathematically-descriptive language type are context free. regexp - especially w/ back-references - is not the same thing. | |
| Apr 10, 2015 at 12:21 | vote | accept | Vrakfall | ||
| Apr 10, 2015 at 12:03 | history | edited | Vrakfall | CC BY-SA 3.0 |
deleted 2 characters in body
|
| Apr 10, 2015 at 11:48 | answer | added | mikeserv | timeline score: 11 | |
| Apr 10, 2015 at 10:44 | history | edited | Vrakfall | CC BY-SA 3.0 |
deleted 8 characters in body
|
| Apr 10, 2015 at 10:41 | comment | added | Vrakfall |
Well, I know nothing about awk or python so if anything made with that would work, the solution made with those languages are very welcome.
|
|
| Apr 10, 2015 at 10:37 | history | edited | Vrakfall | CC BY-SA 3.0 |
deleted 8 characters in body
|
| Apr 10, 2015 at 10:33 | comment | added | Vrakfall | I can also add this: How do you think the compilers and the context colors on code editors are made ? They're yet able not to take commented parts into account, that is made by programmation. Sed's commands are a kind of programming languages. That is why it still appears possible to me. | |
| Apr 10, 2015 at 10:31 | comment | added | Vrakfall | I see why it is impossible to do it only with regex. What I'm trying to do here is using special sed commands that would allow us to add loops and conditions to that lookaround. Please have a look at this for a better understanding of what commands could do. I appears possible to me to do it this way because it becomes more like a little program. Even if it's impossible, I'm still looking for a solution that would be close to it, like trying avoid simple comments without special cases like those you mentioned. | |
| Apr 10, 2015 at 10:24 | comment | added | ctrl-alt-delor |
sed uses regex, regex is a context-free grammar, comments are a context. This question comes up a lot, on this site and else where. As you say the // bit is easy, but the /*…*/ is impossible. You will think you have done it, after hours of pain, and then you will try /* /* */ or // /* or /* // */ If There is a version of sed that has a comments extension, then that would work. To do it you self try awk or python
|
|
| Apr 10, 2015 at 10:17 | review | First posts | |||
| Apr 10, 2015 at 10:58 | |||||
| Apr 10, 2015 at 10:13 | history | asked | Vrakfall | CC BY-SA 3.0 |