• Regex Test For GNU/Linux Users

    From Farley Flud@fflud@gnu.rocks to comp.os.linux.advocacy on Sat Oct 4 18:23:06 2025
    From Newsgroup: comp.os.linux.advocacy

    I have a boat load of HTML files from which I must excise a certain
    text pattern.

    Here is the pattern consisting of four lines:


    <span class="prompt">
    (%ixxx)
    </span></td>

    Each line can be followed by any number of spaces, tabs, or line
    feeds (LF) characters.

    The (%ixxx) can contain 1, 2, or 3 numeric characters, i.e.
    (%i222), (%i22), or (%i2).

    Each file can contain one or more occurrences of this pattern.

    What regular expression can I use to eliminate all of these
    unwanted lines?

    I am using "Find and Replace" (FAR) which allows regular expression
    entry:

    <findandreplace.sf.net>

    Can anyone answer?

    Ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha!

    Distro lackeys couldn't find the button on their GNOME DE's.

    Ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha!


    Note: the fantastic FAR software likely will not run on that
    infernal piece of shit known as Wayland.
    --
    Gentoo: the only road to GNU/Linux perfection
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From vallor@vallor@vallor.earth to comp.os.linux.advocacy on Sun Oct 5 05:18:09 2025
    From Newsgroup: comp.os.linux.advocacy

    At Sat, 04 Oct 2025 18:23:06 +0000, Farley Flud <fflud@gnu.rocks> wrote:

    I have a boat load of HTML files from which I must excise a certain
    text pattern.

    Here is the pattern consisting of four lines:


    <span class="prompt">
    (%ixxx)
    </span></td>

    Each line can be followed by any number of spaces, tabs, or line
    feeds (LF) characters.

    The (%ixxx) can contain 1, 2, or 3 numeric characters, i.e.
    (%i222), (%i22), or (%i2).

    Each file can contain one or more occurrences of this pattern.

    What regular expression can I use to eliminate all of these
    unwanted lines?

    I am using "Find and Replace" (FAR)

    There's your problem right there. Whip up a perl script
    and be done with it.

    which allows regular expression
    entry:

    <findandreplace.sf.net>

    Can anyone answer?

    Yes.


    Ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha!

    Distro lackeys couldn't find the button on their GNOME DE's.

    Ha, ha, ha, ha, ha, ha, ha, ha, ha, ha, ha!

    Why would you ridicule your audience if you're asking them
    for help?

    Please soak your head in a bucket until you stop moving. kthx.

    Note: the fantastic FAR software likely will not run on that
    infernal piece of shit known as Wayland.

    So...it's a gooey program for something that should be done
    from the command line?

    You truly are inept.
    --
    -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090Ti 24G
    OS: Linux 6.17.0 D: Mint 22.2 DE: Xfce 4.18
    NVIDIA: 580.95.05 Mem: 258G
    "Of all the people I've met you're certainly one of them"
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Farley Flud@ff@linux.rocks to comp.os.linux.advocacy on Sun Oct 5 13:01:49 2025
    From Newsgroup: comp.os.linux.advocacy

    On Sat, 04 Oct 2025 18:23:06 +0000, Farley Flud wrote:


    What regular expression can I use to eliminate all of these
    unwanted lines?

    Can anyone answer?


    As I predicted, no one can answer.

    There are no GNU/Linux users here but only ignoramus dabblers
    and installers, i.e. distro lackeys that, like beggars, take
    whatever is thrown at them.

    But anyway, here is the correct regex:

    <td>[\r\t\s]*<span class="prompt">[\r\t\s]*\(%i[0-9]*\)[\r\t\s]*</span>[\r\t\s]*</td>

    The FAR program is a great tool. It first allows a kind of
    preview by finding all files that match the regex. If no files
    are found then the regex is FUBAR and another one must be
    created.

    FAR also has the option of backing up all files just in case
    an ill-composed regex ends up mangling everything.
    --
    Gentoo: the only road to GNU/Linux perfection.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From vallor@vallor@vallor.earth to comp.os.linux.advocacy on Sun Oct 5 22:40:01 2025
    From Newsgroup: comp.os.linux.advocacy

    At Sun, 05 Oct 2025 13:01:49 +0000, Farley Flud <ff@linux.rocks> wrote:

    On Sat, 04 Oct 2025 18:23:06 +0000, Farley Flud wrote:


    What regular expression can I use to eliminate all of these
    unwanted lines?

    Can anyone answer?


    As I predicted, no one can answer.

    There are no GNU/Linux users here but only ignoramus dabblers
    and installers, i.e. distro lackeys that, like beggars, take
    whatever is thrown at them.

    But anyway, here is the correct regex:

    <td>[\r\t\s]*<span class="prompt">[\r\t\s]*\(%i[0-9]*\)[\r\t\s]*</span>[\r\t\s]*</td>


    So your precious FAR automatically handles $'\n'? You didn't
    mention that before.

    The FAR program is a great tool. It first allows a kind of
    preview by finding all files that match the regex. If no files
    are found then the regex is FUBAR and another one must be
    created.

    FAR also has the option of backing up all files just in case
    an ill-composed regex ends up mangling everything.
    --
    -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090Ti 24G
    OS: Linux 6.17.0 D: Mint 22.2 DE: Xfce 4.18
    NVIDIA: 580.95.05 Mem: 258G
    "Folks who think they know it all bug those of us who do"
    --- Synchronet 3.21a-Linux NewsLink 1.2