Thanks Kerry and Jean - they look great. I will try both in real-world
cases soon and come back if there are major problems I can't solve (likely
any which involve modifying the regex...).
The regex will be used for text files with max about 100 lines - so a
visual check afterwards is possible and in any case high;y advised.
Thanks a gain
Rainer
On Thursday, April 18, 2024 at 5:06:24 PM UTC+2 jj wrote:
> Oops, previous regex will flag :
>
> "tomato-sauce" or "mayonnaise-sauce"
>
> This one is a bit more strict:
> (?<=\s)"[\s\N{U+00A0}]*([^\s\N{U+00A0}"-]+?)[\s\N{U+00A0}]*"
>
> But it will still flag (see the space after tomato-sauce) :
> "tomato-sauce " or "mayonnaise-sauce"
>
> There might be more edge cases, so be cautious.
>
> Jean
> On Thursday, April 18, 2024 at 4:46:17 PM UTC+2 jj wrote:
>
>> Building on Kerri's solution to include non-breaking spaces, tabs and
>> linefeeds, etc.
>>
>> find:
>> "[\s\N{U+00A0}]*([^\s\N{U+00A0}"-]+?)[\s\N{U+00A0}]*"
>>
>> replace:
>> \1
>>
>> [image: Screenshot 2024-04-18 at 16.42.39.png]
>>
>> HTH
>>
>> Jean Jourdain
>> On Thursday, April 18, 2024 at 3:19:21 PM UTC+2 Kerri Hicks wrote:
>>
>>> Maybe this will help?
>>>
>>> --Kerri
>>>
>>> [image: Screenshot 2024-04-18 at 9.16.46 AM.png]
>>>
>>> On Thu, Apr 18, 2024 at 8:37 AM Rainer Krug <[email protected]> wrote:
>>>
>>>> Sure.
>>>> Should be removed: (single words without whitespace or "-")
>>>>
>>>> "singleword" -> singleworls
>>>> "Hello" -> Hello
>>>> " Hello" -> Hello [whitespace after removal of " do not matter]
>>>> " Hello " -> Hello
>>>> "Hello " -> Hello
>>>>
>>>> Should NOT be removed: (strings with whitespace or "-" except ), i.e.
>>>> remain unchanged
>>>>
>>>> "Hello World"
>>>> "Hello big world"
>>>> "tomato-sauce"
>>>> " Hello World "
>>>>
>>>> Hope this helps,
>>>>
>>>> Rainer
>>>>
>>>>
>>>> On Thursday, April 18, 2024 at 11:40:14 AM UTC+2 Kaveh Bazargan wrote:
>>>>
>>>>> can you be more specific? What is the determining factor?
>>>>>
>>>>> - Exactly "this" > this
>>>>> - Only single words
>>>>>
>>>>> pls give some examples of before and after so we can see logic.
>>>>> thanks.
>>>>>
>>>>> On Thu, 18 Apr 2024 at 08:04, Rainer Krug <[email protected]> wrote:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> I had a regex but can't find it anymore (I found the "Manage Pattern"
>>>>>> only now - it always reminds me of Google...).
>>>>>>
>>>>>> Could somebody give me a regex which removes the `"` around "this"
>>>>>> word, but not "this word"?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Rainer
>>>>>>
>>>>>> --
>>>>>> This is the BBEdit Talk public discussion group. If you have a
>>>>>> feature request or believe that the application isn't working correctly,
>>>>>> please email "[email protected]" rather than posting here. Follow
>>>>>> @bbedit on Mastodon: <https://mastodon.social/@bbedit>
>>>>>> ---
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "BBEdit Talk" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to [email protected].
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/bbedit/871a5d1f-aa12-49c5-a058-cec16619ea8cn%40googlegroups.com
>>>>>>
>>>>>> <https://groups.google.com/d/msgid/bbedit/871a5d1f-aa12-49c5-a058-cec16619ea8cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Kaveh Bazargan PhD
>>>>> Director
>>>>> River Valley Technologies <http://rivervalley.io> ● Twitter
>>>>> <https://twitter.com/rivervalley1000> ● LinkedIn
>>>>> <https://www.linkedin.com/in/bazargankaveh/> ● ORCID
>>>>> <https://orcid.org/0000-0002-1414-9098> ● @[email protected]
>>>>> <https://mastodon.social/@kaveh1000>
>>>>> *Accelerating the Communication of Research*
>>>>>
>>>>> *
>>>>> <https://www.linkedin.com/posts/bazargankaveh_ismte-innovation-award-recipient-kaveh-bazargan-activity-7039348552526921728-XAEB/?utm_source=share&utm_medium=member_desktop>
>>>>> [image:
>>>>> https://rivervalley.io/gigabyte-wins-the-alpsp-scholarly-publishing-innovation-award-using-river-valleys-publishing-technology/]
>>>>>
>>>>> <https://rivervalley.io/gigabyte-wins-the-alpsp-scholarly-publishing-innovation-award-using-river-valleys-publishing-technology/>*
>>>>>
>>>> --
>>>> This is the BBEdit Talk public discussion group. If you have a feature
>>>> request or believe that the application isn't working correctly, please
>>>> email "[email protected]" rather than posting here. Follow @bbedit
>>>> on Mastodon: <https://mastodon.social/@bbedit>
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "BBEdit Talk" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>>
>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/bbedit/95a71b97-e6a4-4295-8fe5-f90c29bec001n%40googlegroups.com
>>>>
>>>> <https://groups.google.com/d/msgid/bbedit/95a71b97-e6a4-4295-8fe5-f90c29bec001n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
--
This is the BBEdit Talk public discussion group. If you have a feature request
or believe that the application isn't working correctly, please email
"[email protected]" rather than posting here. Follow @bbedit on Mastodon:
<https://mastodon.social/@bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/bbedit/31584bac-926c-4037-b4bd-599712818bb4n%40googlegroups.com.