Timeline for sed regex fails to capture the entire paragraph containing the pattern
Current License: CC BY-SA 4.0
18 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 16, 2021 at 18:34 | answer | added | jubilatious1 | timeline score: 0 | |
| Aug 2, 2021 at 19:57 | comment | added | Ross Presser |
What am I doing wrong here? You're not using an XML parser. stackoverflow.com/a/1732454/864696
|
|
| Aug 2, 2021 at 17:28 | history | became hot network question | |||
| Aug 2, 2021 at 11:47 | vote | accept | user63898 | ||
| Aug 2, 2021 at 11:06 | answer | added | Kusalananda♦ | timeline score: 5 | |
| Aug 2, 2021 at 11:01 | comment | added | Kusalananda♦ | Please post well-formed XML that we may test answers on. The document fragments that you show are not real XML. | |
| Aug 2, 2021 at 11:00 | history | edited | AdminBee | CC BY-SA 4.0 |
Add relevant information from comment section
|
| Aug 2, 2021 at 11:00 | comment | added | ilkkachu |
[\s\S\n]*? also smell like Perl-isms. In particular, x*? is undefined in standard extended REs; IIRC the GNU implementation treats it as an optional x*, which is the same as just x*. GNU tools support some of the \x classes, but I never remember which ones, and I'm not sure if they work inside [] either.
|
|
| Aug 2, 2021 at 10:59 | comment | added | user63898 | yes im parsing xml | |
| Aug 2, 2021 at 10:58 | comment | added | Kusalananda♦ | Are you in fact parsing XML? There are tools for doing that conveniently, efficiently, and safely. | |
| Aug 2, 2021 at 10:56 | comment | added | ilkkachu | @user63898, what does "linux native" mean for you? Stuff usually available in a default installation of a usual Linux desktop/server distribution? Which probably pretty much means the GNU equivalents of the standard POSIX tools, except that e.g. Debian installs Perl by default too... | |
| Aug 2, 2021 at 10:19 | history | edited | AdminBee | CC BY-SA 4.0 |
Minor rephrasing, re-tag
|
| Aug 2, 2021 at 10:03 | answer | added | terdon♦ | timeline score: 7 | |
| Aug 2, 2021 at 10:02 | answer | added | AdminBee | timeline score: 6 | |
| Aug 2, 2021 at 9:56 | comment | added | AdminBee | Is all text in your file organized in these XML-tag-like structures? Is it in reality an XML file? Alternatively, are the paragraphs you are interested always separated by a blank newline? | |
| Aug 2, 2021 at 9:43 | comment | added | user63898 | yeah sure but they need to be linux native | |
| Aug 2, 2021 at 9:38 | comment | added | terdon♦ | Sed really isn't the best tool for something like this. Are you open to solutions using other tools? | |
| Aug 2, 2021 at 9:26 | history | asked | user63898 | CC BY-SA 4.0 |