• [OT] regex

    From Alan B@21:1/5 to All on Wed Mar 27 14:28:35 2024
    Can anyone recommend an online primer for regex please? I've found a
    few myself but I really want something that's suitable for a very raw
    beginner. TIA.

    --
    Cheers, Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan B@21:1/5 to snipeco.2@gmail.com on Wed Mar 27 15:24:20 2024
    Sn!pe <snipeco.2@gmail.com> wrote:

    Alan B <alanrichardbarker@gmail.com.invalid> wrote:

    Can anyone recommend an online primer for regex please? I've found a
    few myself but I really want something that's suitable for a very raw beginner. TIA.


    The regex chapter (no.11) of the MacSOUP manual is good.
    In case you get no recommendations for a more accessible
    primer, I'd be happy to copy the manual for you.

    I've got MacSOUP installed on my Mojave VM which I've not run for ages.
    Anyway runnng it now and have exracted the manual as a PDF via MacSOUP
    Help. Thanks for the info :)

    --
    Cheers, Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. J. Lodder@21:1/5 to Alan B on Thu Mar 28 11:04:00 2024
    Alan B <alanrichardbarker@gmail.com.invalid> wrote:

    Sn!pe <snipeco.2@gmail.com> wrote:

    Alan B <alanrichardbarker@gmail.com.invalid> wrote:

    Can anyone recommend an online primer for regex please? I've found a
    few myself but I really want something that's suitable for a very raw beginner. TIA.


    The regex chapter (no.11) of the MacSOUP manual is good.
    In case you get no recommendations for a more accessible
    primer, I'd be happy to copy the manual for you.

    I've got MacSOUP installed on my Mojave VM which I've not run for ages. Anyway runnng it now and have exracted the manual as a PDF via MacSOUP
    Help. Thanks for the info :)

    You may want to search on 'regex cheat sheet'.
    These things give all the useful abbreviations on a single page.
    (which is suitable for printing)

    Jan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan B@21:1/5 to All on Thu Mar 28 10:43:59 2024
    On 28 Mar 2024 at 10:04:00 GMT, "J. J. Lodder" <J. J. Lodder> wrote:

    Alan B <alanrichardbarker@gmail.com.invalid> wrote:

    Sn!pe <snipeco.2@gmail.com> wrote:

    Alan B <alanrichardbarker@gmail.com.invalid> wrote:

    Can anyone recommend an online primer for regex please? I've found a
    few myself but I really want something that's suitable for a very raw
    beginner. TIA.


    The regex chapter (no.11) of the MacSOUP manual is good.
    In case you get no recommendations for a more accessible
    primer, I'd be happy to copy the manual for you.

    I've got MacSOUP installed on my Mojave VM which I've not run for ages.
    Anyway runnng it now and have exracted the manual as a PDF via MacSOUP
    Help. Thanks for the info :)

    You may want to search on 'regex cheat sheet'.
    These things give all the useful abbreviations on a single page.
    (which is suitable for printing)

    Yes, thank you for that - I've found several promising links :)

    --
    Cheers, Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin S Taylor@21:1/5 to All on Thu Mar 28 18:36:49 2024
    On 28 Mar 2024, Alan B wrote
    (in article<uu3hlf$3h9i1$1@alanrichardbarker.eternal-september.org>):

    On 28 Mar 2024 at 10:04:00 GMT, "J. J. Lodder" <J. J. Lodder> wrote:

    Alan B<alanrichardbarker@gmail.com.invalid> wrote:

    Sn!pe <snipeco.2@gmail.com> wrote:

    Alan B<alanrichardbarker@gmail.com.invalid> wrote:

    Can anyone recommend an online primer for regex please? I've found a few myself but I really want something that's suitable for a very raw beginner. TIA.

    The regex chapter (no.11) of the MacSOUP manual is good.
    In case you get no recommendations for a more accessible
    primer, I'd be happy to copy the manual for you.

    I've got MacSOUP installed on my Mojave VM which I've not run for ages. Anyway runnng it now and have exracted the manual as a PDF via MacSOUP Help. Thanks for the info :)

    You may want to search on 'regex cheat sheet'.
    These things give all the useful abbreviations on a single page.
    (which is suitable for printing)

    Yes, thank you for that - I've found several promising links :)

    This is useful, not so much as a primer but as a useful tool for a newbie playing with regex:

    https://www.apptorium/com/expressions

    MST

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan B@21:1/5 to correspondence@mRaErMtOiVnEsTtHaIyS on Thu Mar 28 19:27:25 2024
    On 28 Mar 2024 at 18:36:49 GMT, "Martin S Taylor" <correspondence@mRaErMtOiVnEsTtHaIySlor.com> wrote:

    This is useful, not so much as a primer but as a useful tool for a newbie playing with regex:

    https://www.apptorium/com/expressions

    Link corrected: <https://www.apptorium.com/expressions>

    Thanks and only $/£7.99 to purchase after 7-day trial which I've started.

    --
    Cheers, Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bruce Horrocks@21:1/5 to TimH on Thu Mar 28 22:35:51 2024
    On 28/03/2024 22:29, TimH wrote:
    On 28 Mar 2024 at 7:27:25 pm GMT, "Alan B" <alanrichardbarker@gmail.com.invalid> wrote:

    On 28 Mar 2024 at 18:36:49 GMT, "Martin S Taylor"
    <correspondence@mRaErMtOiVnEsTtHaIySlor.com> wrote:

    This is useful, not so much as a primer but as a useful tool for a newbie >>> playing with regex:

    https://www.apptorium/com/expressions

    Link corrected: <https://www.apptorium.com/expressions>

    Thanks and only $/£7.99 to purchase after 7-day trial which I've started.

    +1 thanks - I wanted to recommend this to the OP but couldn't remember its name!

    There are free alternatives e.g <https://regexr.com>

    --
    Bruce Horrocks
    Surrey, England

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From TimH@21:1/5 to alanrichardbarker@gmail.com.invalid on Thu Mar 28 22:29:10 2024
    On 28 Mar 2024 at 7:27:25 pm GMT, "Alan B" <alanrichardbarker@gmail.com.invalid> wrote:

    On 28 Mar 2024 at 18:36:49 GMT, "Martin S Taylor" <correspondence@mRaErMtOiVnEsTtHaIySlor.com> wrote:

    This is useful, not so much as a primer but as a useful tool for a newbie
    playing with regex:

    https://www.apptorium/com/expressions

    Link corrected: <https://www.apptorium.com/expressions>

    Thanks and only $/£7.99 to purchase after 7-day trial which I've started.

    +1 thanks - I wanted to recommend this to the OP but couldn't remember its name!
    --
    TimH
    pull tooth to reply by email

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan B@21:1/5 to Chris Ridd on Fri Mar 29 09:53:49 2024
    Chris Ridd <chrisridd@mac.com> wrote:
    On 28/03/2024 22:35, Bruce Horrocks wrote:
    On 28/03/2024 22:29, TimH wrote:
    On 28 Mar 2024 at 7:27:25 pm GMT, "Alan B"
    <alanrichardbarker@gmail.com.invalid> wrote:

    On 28 Mar 2024 at 18:36:49 GMT, "Martin S Taylor"
    <correspondence@mRaErMtOiVnEsTtHaIySlor.com> wrote:

    This is useful, not so much as a primer but as a useful tool for a
    newbie
    playing with regex:

    https://www.apptorium/com/expressions

    Link corrected: <https://www.apptorium.com/expressions>

    Thanks and only $/£7.99 to purchase after 7-day trial which I've
    started.

    +1 thanks - I wanted to recommend this to the OP but couldn't remember
    its
    name!

    There are free alternatives e.g <https://regexr.com>

    BBEdit uses a good regex engine, and automatically highlights all
    matching text as you write a regex - rather neat. Their manual (PDF) is online at https://www.barebones.com/support/bbedit/index.html#docs and
    has a decent chapter on regexes.

    I already use BBEdit as an alternative to TextEdit but never thought of investigating its regex support! Doh ;-)

    --
    Cheers, Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Ridd@21:1/5 to Bruce Horrocks on Fri Mar 29 09:43:17 2024
    On 28/03/2024 22:35, Bruce Horrocks wrote:
    On 28/03/2024 22:29, TimH wrote:
    On 28 Mar 2024 at 7:27:25 pm GMT, "Alan B"
    <alanrichardbarker@gmail.com.invalid> wrote:

    On 28 Mar 2024 at 18:36:49 GMT, "Martin S Taylor"
    <correspondence@mRaErMtOiVnEsTtHaIySlor.com> wrote:

    This is useful, not so much as a primer but as a useful tool for a
    newbie
    playing with regex:

    https://www.apptorium/com/expressions

    Link corrected: <https://www.apptorium.com/expressions>

    Thanks and only $/£7.99 to purchase after 7-day trial which I've
    started.

    +1 thanks - I wanted to recommend this to the OP but couldn't remember
    its
    name!

    There are free alternatives e.g <https://regexr.com>

    BBEdit uses a good regex engine, and automatically highlights all
    matching text as you write a regex - rather neat. Their manual (PDF) is
    online at https://www.barebones.com/support/bbedit/index.html#docs and
    has a decent chapter on regexes.

    --
    Chris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brooks@21:1/5 to Chris Ridd on Fri Mar 29 11:44:45 2024
    On 29/03/2024 09:43, Chris Ridd wrote:
    [....]
    BBEdit uses a good regex engine, and automatically highlights all
    matching text as you write a regex - rather neat. Their manual (PDF) is online at https://www.barebones.com/support/bbedit/index.html#docs and
    has a decent chapter on regexes.


    *AND* ........ BBEdit is available from the Apple App Store! 🙂

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin S Taylor@21:1/5 to Chris Ridd on Fri Mar 29 12:55:52 2024
    On 29 Mar 2024, Chris Ridd wrote
    (in article <uu62fl$79c0$1@dont-email.me>):

    On 28/03/2024 22:35, Bruce Horrocks wrote:
    On 28/03/2024 22:29, TimH wrote:
    On 28 Mar 2024 at 7:27:25 pm GMT, "Alan B" <alanrichardbarker@gmail.com.invalid> wrote:

    On 28 Mar 2024 at 18:36:49 GMT, "Martin S Taylor" <correspondence@mRaErMtOiVnEsTtHaIySlor.com> wrote:

    This is useful, not so much as a primer but as a useful tool for a newbie
    playing with regex:

    https://www.apptorium/com/expressions

    Link corrected: <https://www.apptorium.com/expressions>

    Thanks and only $/£7.99 to purchase after 7-day trial which I've started.

    +1 thanks - I wanted to recommend this to the OP but couldn't remember its
    name!

    There are free alternatives e.g<https://regexr.com>

    BBEdit uses a good regex engine, and automatically highlights all
    matching text as you write a regex - rather neat. Their manual (PDF) is online at https://www.barebones.com/support/bbedit/index.html#docs and
    has a decent chapter on regexes.

    I'm quite good at using regex to find strings, but is there a regex standard for 'replace'?

    For example, if I want to replace all occurrences of

    <anydigit1><somecharacterstring><anydigit2>

    with

    <samedigit1>"xyz"<samecharacterstring><samedigit2>

    is there a standard syntax to do this, and where can I learn it?

    MST

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Ridd@21:1/5 to Martin S Taylor on Fri Mar 29 19:42:11 2024
    On 29/03/2024 12:55, Martin S Taylor wrote:
    On 29 Mar 2024, Chris Ridd wrote
    (in article <uu62fl$79c0$1@dont-email.me>):

    On 28/03/2024 22:35, Bruce Horrocks wrote:
    On 28/03/2024 22:29, TimH wrote:
    On 28 Mar 2024 at 7:27:25 pm GMT, "Alan B"
    <alanrichardbarker@gmail.com.invalid> wrote:

    On 28 Mar 2024 at 18:36:49 GMT, "Martin S Taylor"
    <correspondence@mRaErMtOiVnEsTtHaIySlor.com> wrote:

    This is useful, not so much as a primer but as a useful tool for a >>>>>> newbie
    playing with regex:

    https://www.apptorium/com/expressions

    Link corrected: <https://www.apptorium.com/expressions>

    Thanks and only $/£7.99 to purchase after 7-day trial which I've
    started.

    +1 thanks - I wanted to recommend this to the OP but couldn't remember >>>> its
    name!

    There are free alternatives e.g<https://regexr.com>

    BBEdit uses a good regex engine, and automatically highlights all
    matching text as you write a regex - rather neat. Their manual (PDF) is
    online at https://www.barebones.com/support/bbedit/index.html#docs and
    has a decent chapter on regexes.

    I'm quite good at using regex to find strings, but is there a regex standard for 'replace'?

    For example, if I want to replace all occurrences of

    <anydigit1><somecharacterstring><anydigit2>

    with

    <samedigit1>"xyz"<samecharacterstring><samedigit2>

    is there a standard syntax to do this, and where can I learn it?

    Yes, there's a common notation for capturing text in the "find"
    expression, and there's a common notation for using those in the
    replacement text.

    You'd do something like search for:

    <any(digit1>)(<somecharacterstring>)<any(digit2>)

    and replace with:

    <same\1"xyz"\2<same\3

    The capture groups can obviously contain expressions etc.

    There are also regex extensions to associate a name with a capture
    group, but that's the simplest usage.

    --
    Chris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan B@21:1/5 to Alan B on Sat Mar 30 13:45:01 2024
    On 2024-03-30, Alan B <alanrichardbarker@gmail.com.invalid> wrote:


    Yes the Pattern Playground feature is proving very educational. I don't think I'll ever become a competent regex-er but its improving my understanding quite a bit :)

    ... its -> it's ...

    --
    Cheers, Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan B@21:1/5 to Chris Ridd on Sat Mar 30 13:43:00 2024
    On 2024-03-29, Chris Ridd <chrisridd@mac.com> wrote:
    On 28/03/2024 22:35, Bruce Horrocks wrote:
    On 28/03/2024 22:29, TimH wrote:
    On 28 Mar 2024 at 7:27:25 pm GMT, "Alan B"
    <alanrichardbarker@gmail.com.invalid> wrote:

    On 28 Mar 2024 at 18:36:49 GMT, "Martin S Taylor"
    <correspondence@mRaErMtOiVnEsTtHaIySlor.com> wrote:

    This is useful, not so much as a primer but as a useful tool for a
    newbie
    playing with regex:

    https://www.apptorium/com/expressions

    Link corrected: <https://www.apptorium.com/expressions>

    Thanks and only $/£7.99 to purchase after 7-day trial which I've
    started.

    +1 thanks - I wanted to recommend this to the OP but couldn't remember
    its
    name!

    There are free alternatives e.g <https://regexr.com>

    BBEdit uses a good regex engine, and automatically highlights all
    matching text as you write a regex - rather neat. Their manual (PDF) is online at https://www.barebones.com/support/bbedit/index.html#docs and
    has a decent chapter on regexes.

    Yes the Pattern Playground feature is proving very educational. I don't think I'll ever become a competent regex-er but its improving my understanding
    quite a bit :)

    --
    Cheers, Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)