Skip to main content

All Questions

Tagged with
1 vote
1 answer
48 views

Regex for nested tag detection

I have a document generation application that handles tag replacement, I use a regular expression to detect said tags. These tags can be of multiple types, for the sake of the problem let's take into ...
Filipe Nóbrega's user avatar
0 votes
0 answers
51 views

extract string emojis from text [duplicate]

i want to extract string emojis from string to array of string. Previously, i had this regex: const regex = /([\u{1F600}-\u{1F64F}])/gu and i was using it like this: const parts = text.split(regex)....
Dawken's user avatar
  • 11
0 votes
2 answers
87 views

Any Regex question to split a summary from txt file

I'm trying to extract some content from txt file (from pdf conversion). You can notice space (or not) after label or before page_number and sometimes, there is no \n between page_number and X.Y.Z code ...
A.Dumas's user avatar
  • 81
1 vote
1 answer
56 views

Notepad++ and regex: how to UPPERCASE only first letter in specific words with / find / replace [duplicate]

This is the given situation: INPUT TEXT jjj=Johann{enter}{enter} uuu=08:30{tab}18:00{tab} vvv=08:30{up}18:45{down}08:30{left}18:45{right}08:30{tab} OUTPUT TEXT (goal) jjj=Johann{Enter}...
Johann Sterzik's user avatar
0 votes
2 answers
56 views

Regular expression to match up to the first space of a line not preceeded by a comma

I'm editing a large dictionary file and the term and definition pairs do not have a consistent format. Some words are "simple", some words include the base term plus some suffix to alter ...
M1KEMEX's user avatar
5 votes
3 answers
320 views

Regular expression for zero-width Unicode characters

I’m converting a table to a human-readable form, and I need to treat the content with zero-length Unicode characters “in a distinctive way”. The only way to recognize them seems to be (even with Perl’...
Ilya Zakharevich's user avatar
-2 votes
2 answers
177 views

One-liner to delete any line that starts with a number not followed by a delimiter

This two-line python code works. Can it be made concise? Thanks. temp_test_001 = ''' Test 1,2,3, 41 Test 5,6,7, 8800 8800 8800 8800. 8800.0 8,800 Test 9,10 Test 11,12 '''.split('\n') lines = '' for ...
Krantz's user avatar
  • 1,493
-4 votes
3 answers
81 views

What regular expression should I use to extract stock symbols from text file?

I would like to extract all the symbols from a text file with a regular expression, ALLY, AMZN, AXP, AON, etc... The following data is in a text file Symbol Holdings Stake Mkt. price Value ...
Mahmoud Abdel-Rahman's user avatar
0 votes
1 answer
574 views

Ansible - Replace all text between two specified lines in file with ansible.builtin.replace module

I've been trying to replace all text between two specified lines in a configuration file using Ansible. With this task block, I simply want to remove all text between the two specified lines. In the ...
Eschin Tenebrous's user avatar
0 votes
2 answers
71 views

Why Does 'grep' Change Text Format in Swaymsg Output? [closed]

I'm using swaymsg -t get_inputs | grep to filter input device information, but I've noticed that grep is altering the text format. Using grep: $ swaymsg -t get_inputs | grep -i touch "...
Abdelrahman Essawy's user avatar
0 votes
1 answer
234 views

Text cleanup in snowflake

I have a column in a table that contains data about any updates related to changes about a company in the below format - #=============#==============#================# | Company ID | updated_at | ...
Abhigyan Sarma's user avatar
-2 votes
1 answer
181 views

Filtering a string in regex [closed]

I am trying to use regex for the first time because I have a very large text file (over 2000 lines) that contains some data I need to parse and correct. Consider the following: |C170|14|1712||5,00000|...
Xander's user avatar
  • 1
2 votes
1 answer
52 views

In R Str_count: Counting occurrences of words at a certain distance e.g. 1 to 30 words apart

In a text document, I want to count the instances when uncertainty|unclear has occurred at a distance of 1 to 30 words from global|decrease in demand|fall in demand. However, my code as below seems to ...
Mohsin's user avatar
  • 33
1 vote
0 answers
89 views

How can I extract a sentence containing a keyword from a block of text

I am aiming to come up with a script that will search a folder of log files for a specific keyword, and output to a results.txt file the name of the file, the line number in each file which contains ...
Col's user avatar
  • 13
1 vote
2 answers
125 views

Python Regex how to remove all words except starting or ending with $

I want to remove all digits except digits starting with $ or ending with $. Below is the sample text "\\r\\n-MacBook 2018 $4000 \\r\\n-Apple watch S3\\r\\n-11 5000$ 1000Islands iphone$1000 200$...
ANUJ PATEL's user avatar

15 30 50 per page
1
2 3 4 5
83