Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Regex to find triple characters
Post: RE: Regex to find triple characters

(May-14-2024, 01:08 PM)deanhystad Wrote: (May-14-2024, 12:27 PM)bfallert Wrote: Thank you, but this expression still allows matching consecutive characters other than exactly 3. Doubles, quads or ...
bfallert General Coding Help 14 390 May-14-2024, 01:28 PM
    Thread: Regex to find triple characters
Post: RE: Regex to find triple characters

(May-14-2024, 12:51 PM)Gribouillis Wrote: (May-14-2024, 12:29 PM)bfallert Wrote: there is a compilation error stating that groups are not supported in lookbehinds.Which version of Python are you u...
bfallert General Coding Help 14 390 May-14-2024, 01:22 PM
    Thread: Regex to find triple characters
Post: RE: Regex to find triple characters

Thank you, but this solution allows consecutive characters of more than 3 to slip through. I need the expression to specifically look for exactly 3 consecutive characters.
bfallert General Coding Help 14 390 May-14-2024, 12:32 PM
    Thread: Regex to find triple characters
Post: RE: Regex to find triple characters

(May-14-2024, 08:14 AM)Gribouillis Wrote: This perhaps >>> import re >>> p = re.compile(r'(\w)(?<!\1\1)\1\1(?!\1)') >>> >>> [m.group() for m in p.finditer('ab...
bfallert General Coding Help 14 390 May-14-2024, 12:29 PM
    Thread: Regex to find triple characters
Post: RE: Regex to find triple characters

(May-14-2024, 05:59 AM)deanhystad Wrote: import re matches =[match.group() for match in re.finditer(r"(.)\1{1,}", "AAAbbcDDDEDGGGG")] print(matches)Output:['AAA', 'bb', 'DDD', 'GGGG'] Thank you, but...
bfallert General Coding Help 14 390 May-14-2024, 12:27 PM
    Thread: Regex to find triple characters
Post: Regex to find triple characters

I am looking for a regex pattern to find the instance of 3 matching characters in series in a string. The characters can be letters or numbers, but can only be 3 characters in length and all be the sa...
bfallert General Coding Help 14 390 May-14-2024, 12:28 AM
    Thread: Using Lists as Dictionary Values
Post: RE: Using Lists as Dictionary Values

The last part of the code assigns the list to a unique key in the dictionary. I was hoping to end up with a large dictionary of unique keys and a different list as the value for each key.
bfallert General Coding Help 8 477 Apr-20-2024, 09:55 PM
    Thread: Using Lists as Dictionary Values
Post: RE: Using Lists as Dictionary Values

Here is the code. The data comes from a file with lines of 15 pieces of text separated by a space. The first piece of text in each line will become the 'key' and a temporary list is made of other piec...
bfallert General Coding Help 8 477 Apr-20-2024, 02:23 PM
  Question Thread: Using Lists as Dictionary Values
Post: Using Lists as Dictionary Values

I am trying to use lists as dictionary values. I am running a loop that creates a new list each time and then assigns it to a specific key. The iteration works the first time. However, when I clear th...
bfallert General Coding Help 8 477 Apr-19-2024, 08:30 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020