Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [regex]

Also known as regular expression or regexp, a description of a set of strings, often used for searching and validating strings.

0
votes
1answer
12 views

Notepad++ flipping/reordering lines

I have many instances of the following code block, simplified: $image = ''; $name = ''; $link = ''; $role_suffix = ''; $role_name = ''; $notes = ''; All these variables contain different data. I ...
1
vote
0answers
43 views

Modify recurring text/string in txt file based on matching text/parameter(s)

I have a text file named example.txt, which contains: [{ "Subtitle": { "Search": { "Burn": false, "Default": false, "Enable": false, "Forced": ...
2
votes
1answer
33 views

Why does Emacs replace mixed case text with uppercase?

In Emacs, when I replace the following list with regexp opeN \1 closE: A001X B002X C003X It converts all to uppercase: OPEN A001X CLOSE OPEN B002X CLOSE OPEN C003X CLOSE Which is not what I ...
0
votes
0answers
58 views

Rename filename based on partial filename match

I have some files in a folder that are named like: Filename.Part.1-FromSource.avi Filename.Part.1.avi 16-05-2019 15-41-01.txt Length of .avi filename is variable I would like to rename the .txt ...
3
votes
1answer
59 views

Rename substring of filename based on partial filename match in same folder

I have a folder full of files (.avi and .txt files): 'MyVideo1-MyEncode.avi' 'MyVideo1.avi 16-05-2019 15-41-01.txt' 'My Video 2.avi' 'My Video 2.avi 16-05-2019 16-43-11.txt' 'My Video 3 [Summer]-...
0
votes
2answers
34 views

I need the Regex to get exactly string

I need the Regex that select only string1 string1: potato string2: potato2 string3: 1potato string4: 1potato2 Thanks
1
vote
3answers
34 views

Notepad++ and XML - Replace and capitalize the first letter of all words in a tag element

I have an XML file with the following structure: <id>1</id> <name>alligator and stingray</name> ... <id>99999</id> <name>dolphin with carp</name> I ...
0
votes
0answers
18 views

Counting distinct substring in SQLite

My SQLite database contains a column listing file names. A naming convention is that sometimes (not always) the name ends (before the extension) with a dot and a version number: 'x.y' where x and y ...
1
vote
2answers
32 views

VIM regex pattern unable to search and replace characters that are between braces

I want to use regex to convert these: <input type="text" name="salutation" value={salutation} /> <input type="text" name="first_name" value={first_name} /> into these: <input type="...
0
votes
1answer
12 views

Emacs regular expression: Backreference contains nothing

Recently I switched from Sublime to Emacs with Evil mode. After configuring I'm trying to use it productively but I can't find a way to use the backreference in Emacs. In the manual it says I have to ...
1
vote
1answer
39 views

Surround certain string with specified characters using regex-capable editor

I need to format certain string in Sphinx's documentation H2 Header. Example: v-add-user should be replaced with ********* v-add-user ********* I search for needed string in Notepad++ (regex ^(...
0
votes
1answer
32 views

Notepad++ RegEx Only change last line in specific file

The problem is i want to comment out a specific string in some files. In most of them it looks like this countries = {"GER","NZG",} Replacing this is trivial. However there are some exception in ...
0
votes
0answers
21 views

How do I create a rule for 404 errors in Fail2Ban?

I created this rule on Fail2Ban to ban IPs that cause too many 404 errors. So far it is working, but sometimes I get lots of weird errors like this: 7f36e296b1c0 -- stderr: "Try `iptables -h' or '...
0
votes
0answers
15 views

Powershell: Find the occurence of “$t(ANYTHING)” in nested folder and output to file

I got a nested folder structure with different files and filetypes. In the *.js-files there are occurences of the string "$t(ANY_STRING)". Now I want to write a powershell script that scans all of ...
0
votes
2answers
77 views

notepad++ regex for replacing Capital/uppercase letter in the middle of word with small/lowercase

I'm constantly working with recognition of text and I end up having capital/uppercase letters in the middle or at the end of the words (e.g. wOrd instead of word; leSS instead of less). Is there a ...

15 30 50 per page