08-22-2023 08:28 AM
@Eric1977 wrote:
I didn't know that not placing a replacement character can slow it down. I'll keep that in the memory bank for the next time I use it.
Same. Kudos for the tip!
-Kevin P
08-22-2023 08:39 AM
@Eric1977 wrote:
wiebe@CARYA wrote:
However, if you set Search and Replace String to match a regular expression:
It count the replacements out of the box.
Note that I replace with a character (any character will do). If you don't wire the replacement, the string will be shrunk for every replacement, slowing things down.
I didn't know that not placing a replacement character can slow it down. I'll keep that in the memory bank for the next time I use it.
I guess it gets more complicated if you add "sometimes 'y'".
08-23-2023 02:32 AM
@billko wrote:
@Eric1977 wrote:
wiebe@CARYA wrote:
However, if you set Search and Replace String to match a regular expression:
It count the replacements out of the box.
Note that I replace with a character (any character will do). If you don't wire the replacement, the string will be shrunk for every replacement, slowing things down.
I didn't know that not placing a replacement character can slow it down. I'll keep that in the memory bank for the next time I use it.
I guess it gets more complicated if you add "sometimes 'y'".
Yes, but not by much:
Since the entire match is a capturing group (the first) we can replace the match with itself (indicated by "$1").
08-23-2023 08:09 AM
wiebe@CARYA wrote:
@billko wrote:
@Eric1977 wrote:
wiebe@CARYA wrote:
However, if you set Search and Replace String to match a regular expression:
It count the replacements out of the box.
Note that I replace with a character (any character will do). If you don't wire the replacement, the string will be shrunk for every replacement, slowing things down.
I didn't know that not placing a replacement character can slow it down. I'll keep that in the memory bank for the next time I use it.
I guess it gets more complicated if you add "sometimes 'y'".
Yes, but not by much:
Since the entire match is a capturing group (the first) we can replace the match with itself (indicated by "$1").
But "y" is only a vowel (in the US) under certain conditions.
08-23-2023 08:31 AM - edited 08-23-2023 08:33 AM
@billko wrote:
wiebe@CARYA wrote:
@billko wrote:
@Eric1977 wrote:
wiebe@CARYA wrote:
However, if you set Search and Replace String to match a regular expression:
It count the replacements out of the box.
Note that I replace with a character (any character will do). If you don't wire the replacement, the string will be shrunk for every replacement, slowing things down.
I didn't know that not placing a replacement character can slow it down. I'll keep that in the memory bank for the next time I use it.
I guess it gets more complicated if you add "sometimes 'y'".
Yes, but not by much:
Since the entire match is a capturing group (the first) we can replace the match with itself (indicated by "$1").
But "y" is only a vowel (in the US) under certain conditions.
Ah, didn't know that.
That would make a funky regex.
But if there is one online, it will work.
Here's a discussion about vowels vs consonants regex's, but I don't think that covers it all: Regex - matching world which contain only vowels or consonants - Stack Overflow
08-23-2023 08:50 AM
wiebe@CARYA wrote:
@billko wrote:
wiebe@CARYA wrote:
@billko wrote:
@Eric1977 wrote:
wiebe@CARYA wrote:
However, if you set Search and Replace String to match a regular expression:
It count the replacements out of the box.
Note that I replace with a character (any character will do). If you don't wire the replacement, the string will be shrunk for every replacement, slowing things down.
I didn't know that not placing a replacement character can slow it down. I'll keep that in the memory bank for the next time I use it.
I guess it gets more complicated if you add "sometimes 'y'".
Yes, but not by much:
Since the entire match is a capturing group (the first) we can replace the match with itself (indicated by "$1").
But "y" is only a vowel (in the US) under certain conditions.
Ah, didn't know that.
That would make a funky regex.
But if there is one online, it will work.
Here's a discussion about vowels vs consonants regex's, but I don't think that covers it all: Regex - matching world which contain only vowels or consonants - Stack Overflow
I never thought of that. Someone, somewhere probably made a regex for that!
OMG here's what ChatGPT came up with:
[aeiouAEIOUYy](?<![aeiouAEIOUy])[aeiouAEIOU]*$|(?<=[aeiouAEIOYy])y(?![aeiouAEIOUy])
Explanation:
[aeiouAEIOUYy]
matches any vowel, including 'y' in both lowercase and uppercase.(?<![aeiouAEIOUy])[aeiouAEIOU]*$
matches a vowel (excluding 'y') that is at the end of a word or syllable. The (?<![aeiouAEIOUy])
is a negative lookbehind that ensures there's no vowel or 'y' before the vowel we're matching.(?<=[aeiouAEIOYy])y(?![aeiouAEIOUy])
matches 'y' that is surrounded by vowels (including 'y') in the middle of a syllable. The (?<=[aeiouAEIOYy])
is a positive lookbehind that ensures there's a vowel or 'y' before the 'y', and the (?![aeiouAEIOUy])
is a negative lookahead that ensures there's no vowel or 'y' after the 'y'.08-23-2023 08:58 AM
@billko wrote:
wiebe@CARYA wrote:
@billko wrote:
wiebe@CARYA wrote:
@billko wrote:
@Eric1977 wrote:
wiebe@CARYA wrote:
However, if you set Search and Replace String to match a regular expression:
It count the replacements out of the box.
Note that I replace with a character (any character will do). If you don't wire the replacement, the string will be shrunk for every replacement, slowing things down.
I didn't know that not placing a replacement character can slow it down. I'll keep that in the memory bank for the next time I use it.
I guess it gets more complicated if you add "sometimes 'y'".
Yes, but not by much:
Since the entire match is a capturing group (the first) we can replace the match with itself (indicated by "$1").
But "y" is only a vowel (in the US) under certain conditions.
Ah, didn't know that.
That would make a funky regex.
But if there is one online, it will work.
Here's a discussion about vowels vs consonants regex's, but I don't think that covers it all: Regex - matching world which contain only vowels or consonants - Stack Overflow
I never thought of that. Someone, somewhere probably made a regex for that!
OMG here's what ChatGPT came up with:
[aeiouAEIOUYy](?<![aeiouAEIOUy])[aeiouAEIOU]*$|(?<=[aeiouAEIOYy])y(?![aeiouAEIOUy])
Explanation:
[aeiouAEIOUYy]
matches any vowel, including 'y' in both lowercase and uppercase.(?<![aeiouAEIOUy])[aeiouAEIOU]*$
matches a vowel (excluding 'y') that is at the end of a word or syllable. The(?<![aeiouAEIOUy])
is a negative lookbehind that ensures there's no vowel or 'y' before the vowel we're matching.(?<=[aeiouAEIOYy])y(?![aeiouAEIOUy])
matches 'y' that is surrounded by vowels (including 'y') in the middle of a syllable. The(?<=[aeiouAEIOYy])
is a positive lookbehind that ensures there's a vowel or 'y' before the 'y', and the(?![aeiouAEIOUy])
is a negative lookahead that ensures there's no vowel or 'y' after the 'y'.
At a glance, it looks like it will check a word for vowels.
It doesn't seem to check vowels in a text. Or at least I don't see anything related to word barriers.
08-23-2023 09:32 AM
wiebe@CARYA wrote:
@billko wrote:
wiebe@CARYA wrote:
@billko wrote:
wiebe@CARYA wrote:
@billko wrote:
@Eric1977 wrote:
wiebe@CARYA wrote:
However, if you set Search and Replace String to match a regular expression:
It count the replacements out of the box.
Note that I replace with a character (any character will do). If you don't wire the replacement, the string will be shrunk for every replacement, slowing things down.
I didn't know that not placing a replacement character can slow it down. I'll keep that in the memory bank for the next time I use it.
I guess it gets more complicated if you add "sometimes 'y'".
Yes, but not by much:
Since the entire match is a capturing group (the first) we can replace the match with itself (indicated by "$1").
But "y" is only a vowel (in the US) under certain conditions.
Ah, didn't know that.
That would make a funky regex.
But if there is one online, it will work.
Here's a discussion about vowels vs consonants regex's, but I don't think that covers it all: Regex - matching world which contain only vowels or consonants - Stack Overflow
I never thought of that. Someone, somewhere probably made a regex for that!
OMG here's what ChatGPT came up with:
[aeiouAEIOUYy](?<![aeiouAEIOUy])[aeiouAEIOU]*$|(?<=[aeiouAEIOYy])y(?![aeiouAEIOUy])
Explanation:
[aeiouAEIOUYy]
matches any vowel, including 'y' in both lowercase and uppercase.(?<![aeiouAEIOUy])[aeiouAEIOU]*$
matches a vowel (excluding 'y') that is at the end of a word or syllable. The(?<![aeiouAEIOUy])
is a negative lookbehind that ensures there's no vowel or 'y' before the vowel we're matching.(?<=[aeiouAEIOYy])y(?![aeiouAEIOUy])
matches 'y' that is surrounded by vowels (including 'y') in the middle of a syllable. The(?<=[aeiouAEIOYy])
is a positive lookbehind that ensures there's a vowel or 'y' before the 'y', and the(?![aeiouAEIOUy])
is a negative lookahead that ensures there's no vowel or 'y' after the 'y'.At a glance, it looks like it will check a word for vowels.
It doesn't seem to check vowels in a text. Or at least I don't see anything related to word barriers.
The rules I gave it related to a single word. I forgot about that.
08-24-2023 03:15 AM
@billko wrote:
wiebe@CARYA wrote:
@billko wrote:
wiebe@CARYA wrote:
@billko wrote:
wiebe@CARYA wrote:
@billko wrote:
@Eric1977 wrote:
wiebe@CARYA wrote:
However, if you set Search and Replace String to match a regular expression:
It count the replacements out of the box.
Note that I replace with a character (any character will do). If you don't wire the replacement, the string will be shrunk for every replacement, slowing things down.
I didn't know that not placing a replacement character can slow it down. I'll keep that in the memory bank for the next time I use it.
I guess it gets more complicated if you add "sometimes 'y'".
Yes, but not by much:
Since the entire match is a capturing group (the first) we can replace the match with itself (indicated by "$1").
But "y" is only a vowel (in the US) under certain conditions.
Ah, didn't know that.
That would make a funky regex.
But if there is one online, it will work.
Here's a discussion about vowels vs consonants regex's, but I don't think that covers it all: Regex - matching world which contain only vowels or consonants - Stack Overflow
I never thought of that. Someone, somewhere probably made a regex for that!
OMG here's what ChatGPT came up with:
[aeiouAEIOUYy](?<![aeiouAEIOUy])[aeiouAEIOU]*$|(?<=[aeiouAEIOYy])y(?![aeiouAEIOUy])
Explanation:
[aeiouAEIOUYy]
matches any vowel, including 'y' in both lowercase and uppercase.(?<![aeiouAEIOUy])[aeiouAEIOU]*$
matches a vowel (excluding 'y') that is at the end of a word or syllable. The(?<![aeiouAEIOUy])
is a negative lookbehind that ensures there's no vowel or 'y' before the vowel we're matching.(?<=[aeiouAEIOYy])y(?![aeiouAEIOUy])
matches 'y' that is surrounded by vowels (including 'y') in the middle of a syllable. The(?<=[aeiouAEIOYy])
is a positive lookbehind that ensures there's a vowel or 'y' before the 'y', and the(?![aeiouAEIOUy])
is a negative lookahead that ensures there's no vowel or 'y' after the 'y'.At a glance, it looks like it will check a word for vowels.
It doesn't seem to check vowels in a text. Or at least I don't see anything related to word barriers.
The rules I gave it related to a single word. I forgot about that.
AI or not, it's still a computer 😂...
08-24-2023 12:22 PM
wiebe@CARYA wrote:
@billko wrote:
wiebe@CARYA wrote:
@billko wrote:
wiebe@CARYA wrote:
@billko wrote:
wiebe@CARYA wrote:
@billko wrote:
@Eric1977 wrote:
wiebe@CARYA wrote:
However, if you set Search and Replace String to match a regular expression:
It count the replacements out of the box.
Note that I replace with a character (any character will do). If you don't wire the replacement, the string will be shrunk for every replacement, slowing things down.
I didn't know that not placing a replacement character can slow it down. I'll keep that in the memory bank for the next time I use it.
I guess it gets more complicated if you add "sometimes 'y'".
Yes, but not by much:
Since the entire match is a capturing group (the first) we can replace the match with itself (indicated by "$1").
But "y" is only a vowel (in the US) under certain conditions.
Ah, didn't know that.
That would make a funky regex.
But if there is one online, it will work.
Here's a discussion about vowels vs consonants regex's, but I don't think that covers it all: Regex - matching world which contain only vowels or consonants - Stack Overflow
I never thought of that. Someone, somewhere probably made a regex for that!
OMG here's what ChatGPT came up with:
[aeiouAEIOUYy](?<![aeiouAEIOUy])[aeiouAEIOU]*$|(?<=[aeiouAEIOYy])y(?![aeiouAEIOUy])
Explanation:
[aeiouAEIOUYy]
matches any vowel, including 'y' in both lowercase and uppercase.(?<![aeiouAEIOUy])[aeiouAEIOU]*$
matches a vowel (excluding 'y') that is at the end of a word or syllable. The(?<![aeiouAEIOUy])
is a negative lookbehind that ensures there's no vowel or 'y' before the vowel we're matching.(?<=[aeiouAEIOYy])y(?![aeiouAEIOUy])
matches 'y' that is surrounded by vowels (including 'y') in the middle of a syllable. The(?<=[aeiouAEIOYy])
is a positive lookbehind that ensures there's a vowel or 'y' before the 'y', and the(?![aeiouAEIOUy])
is a negative lookahead that ensures there's no vowel or 'y' after the 'y'.At a glance, it looks like it will check a word for vowels.
It doesn't seem to check vowels in a text. Or at least I don't see anything related to word barriers.
The rules I gave it related to a single word. I forgot about that.
AI or not, it's still a computer 😂...
I know. It did exactly what I told it to do, which may or may not be what I wanted it to do.