Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

regex

Natural sorting

August 18, 2022 by Magenaut

I have some files that need to be sorted by name, unfortunately I can’t use a regular sort, because I also want to sort the numbers in the string, so I did some research and found that what I am looking for is called natural sorting.

Categories Python, Q&A Tags natural-sort, python, regex, sorting Leave a comment

Find longest repetitive sequence in a string

August 18, 2022 by Magenaut

I need to find the longest sequence in a string with the caveat that the sequence must be repeated three or more times. So, for example, if my string is:

Categories Python, Q&A Tags algorithm, python, regex, string Leave a comment

Python regular expressions – how to capture multiple groups from a wildcard expression?

August 18, 2022 by Magenaut

I have a Python regular expression that contains a group which can occur zero or many times – but when I retrieve the list of groups afterwards, only the last one is present. Example:

Categories Python, Q&A Tags lexical-analysis, python, regex Leave a comment

Python Regex instantly replace groups

August 17, 2022 by Magenaut

Is there any way to directly replace all groups using regex syntax?

Categories Python, Q&A Tags python, regex, regex-group Leave a comment

regex for Twitter username

August 17, 2022 by Magenaut

Could you provide a regex that match Twitter usernames?

Categories Python, Q&A Tags python, regex, twitter Leave a comment

Use Python’s string.replace vs re.sub

August 17, 2022 by Magenaut

For Python 2.5, 2.6, should I be using string.replace or re.sub for basic text replacements?

Categories Python, Q&A Tags python, regex Leave a comment

Regular Expressions: Search in list

August 17, 2022 by Magenaut

I want to filter strings in a list based on a regular expression.

Categories Python, Q&A Tags python, regex Leave a comment

Matching Nested Structures With Regular Expressions in Python

August 17, 2022 by Magenaut

I seem to remember that Regular Expressions in DotNet have a special mechanism that allows for the correct matching of nested structures, like the grouping in “( (a ( ( c ) b ) ) ( d ) e )“.

Categories Python, Q&A Tags python, recursive-regex, regex Leave a comment

regex error – nothing to repeat

August 17, 2022 by Magenaut

I get an error message when I use this expression:

Categories Python, Q&A Tags python, regex Leave a comment

BeautifulSoup – search by text inside a tag

August 17, 2022 by Magenaut

Observe the following problem:

Categories Python, Q&A Tags beautifulsoup, python, regex Leave a comment
Older posts
Newer posts
← Previous Page1 … Page11 Page12 Page13 … Page20 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress