Skip to content

Magenaut

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

regular-expression

How can I “grep” patterns across multiple lines?

August 11, 2022 by Magenaut

It seems I am misusing grep/egrep.

Categories Q&A, Unix & Linux Tags file-search, grep, regular-expression, search Leave a comment

Splitting text files based on a regular expression

August 11, 2022 by Magenaut

I have a text file which I want to split into 64 unequal parts, according to the 64 hexagrams of the Yi Jing. Since the passage for each hexagram begins with some digit(s), a period, and two newlines, the regex should be pretty easy to write.

Categories Q&A, Unix & Linux Tags regular-expression, split Leave a comment

find words with all vowels in order from a file

August 10, 2022 by Magenaut

I have a large dictionary file with 300,000+ words in it and I’m trying to find all words with the vowels aeiou in that order and have only exactly 5 vowels. My current attempt does not seem to be working and for the life of me I don’t understand why.

Categories Q&A, Unix & Linux Tags grep, regular-expression Leave a comment

Using regex inside if clause in bash

August 10, 2022 by Magenaut

Look at this if block:

Categories Q&A, Unix & Linux Tags bash, regular-expression Leave a comment

Checking if an input number is an integer

August 10, 2022 by Magenaut

I’m trying to check if an input is an integer and I’ve gone over it a hundred times but don’t see the error in this. Alas it does not work, it triggers the if statement for all inputs (numbers/letters)

Categories Q&A, Unix & Linux Tags bash, quoting, regular-expression, test Leave a comment

Bash =~ regex and https://regex101.com/

August 10, 2022 by Magenaut

Using https://regex101.com/ I built a regular expression to return the first occurrence of an IP address in a string.

Categories Q&A, Unix & Linux Tags bash, regular-expression Leave a comment

sed one-liner to delete everything between a pair of brackets?

August 10, 2022 by Magenaut

I am working with some text that is full of stuff between brackets [] that I don’t want. Since I can delete the brackets myself, I don’t need the one-liner to do that for me, but I do need a one-liner that will remove everything between them.

Categories Q&A, Unix & Linux Tags regular-expression, sed Leave a comment

Renaming files to have lower case extensions with ‘rename’

August 10, 2022 by Magenaut

I’m trying to currently rename a large set of files and have been using quite kludgy methods to do so, such as:

Categories Q&A, Unix & Linux Tags perl, regular-expression, rename Leave a comment

Shell test to find a pattern in a string

August 9, 2022 by Magenaut

I just wanted to ask whether there is any command which would work on common shells (bash, dash, kornshell)? It is supposed to check if the line variable contains any part of the path.

Categories Q&A, Unix & Linux Tags regular-expression, shell, string Leave a comment

Search and replace strings that are not substrings of other strings

August 9, 2022 by Magenaut

I have a list of replacements like so:

Categories Q&A, Unix & Linux Tags regular-expression, replace, sed, text-processing Leave a comment
Older posts
Page1 Page2 … Page4 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