Questions tagged [regex]
Regular expressions provide a declarative language to match patterns within strings. They are commonly used for string validation, parsing, and transformation. Specify the language (PHP, Python, etc) or tool (grep, VS Code, Google Analytics, etc) that you are using. Do not post questions asking for an explanation of what a symbol means or what a particular regular expression will match.
260,486
questions
-2
votes
0
answers
23
views
Regex code to read out coordinates from a single line [duplicate]
I have a string from which I want to read the coordinates for the X axis.
Here my String:
G74X106.5Y-49.Z-22.6P1800Q51000F0.28R0.1
Here what i like to get:
106.5
In addition, the whole thing should ...
1
vote
0
answers
18
views
How to parse pdf in r and then correctly convert or extract spaced/tabbed pieces of text into columns of dataframe?
I am reading a pdf in r using library(pdftools)
library(tidyverse)
library(pdftools)
library(lubridate)
pdf_rowwise <- strsplit(pdf_text("V://path//sample.pdf"), split = "\n")
...
2
votes
1
answer
21
views
Match list of host in mongo query doesn't work
I have below query :
mydb.my-collection.aggregate([
{
$match: {
$and: [
{timestamp:
{
$gte: $__timeFrom,
$lte: $__timeTo
}}
...
3
votes
1
answer
47
views
Parsing formulas efficiently using regex and Polars
I am trying to parse a series of mathematical formulas and need to extract variable names efficiently using Polars in Python.
Regex support in Polars seems to be limited, particularly with look-around ...
0
votes
0
answers
27
views
How can I expand a regex to find the entire URL in these cases?
I need to match complete blogger.googleusercontent.com image link URLs that include the /img/a/ subdirectories. The URLs are for images, and the file names don't have file extensions, but that may not ...
-4
votes
0
answers
36
views
regex is failing in first char itself [closed]
^[^\s][\/s]*[A-Z0-9][A-Z0-9\.\,\:\;\/\-]*$
above is regex if i enter M it is failing or does not match.
what changes i can make in above regex?
1
vote
2
answers
52
views
How to extract or capture the value from stdout_lines of an Ansible playbook?
I am looking for help to extract or capture the free MB value from the stdout_lines of an Ansible playbook execution and use that value as a criteria to proceed further in the playbook.
My task output ...
-1
votes
2
answers
51
views
Add space after specified data using regular expression in Visual Studio
As we all know, Visual Studio has very powerful text editing functions. Now there are hundreds of thousands of data in my txt file. I made a wrong operation, which caused some problems with the data.
...
3
votes
1
answer
46
views
python regex to get text within a pattern defined
I'm working on writing a parser to extract information from the output given below
i need to get all the three texts which are in between '--'. so i wrote a regular expression as below
import re
def ...
0
votes
1
answer
49
views
vuejs @input is getting called only after onfocusout, i want to call it when user is typing
i am trying to use @input on input field in vuejs, but the function assigned to it gets called only after user has stopped typing and the focus is out of the input field, that means it is getting ...
0
votes
1
answer
84
views
Issue in masking AccountNumber and CreditCardNo in a free text field [duplicate]
Please re-open the question as scenarios mentioned below are different than the ones which are in linked question. I am awaiting answer from @bobble.
I am having issue in masking the below strings. ...
0
votes
2
answers
29
views
How to limit/cap values exceeding a certain value in Notepad++
I have this snippet of code in yml:
- Item: Oldman's_Romance
Rate: 50
- Item: Grasshopper's_Leg
Rate: 8000
- Item: Azure_Jewel
Rate: 9000
- Item: ...
0
votes
0
answers
17
views
Add Rewrite Rule Not Returning As Expected
I have the following code snippet in WordPress functions.php file:
add_action('init', function() {
add_rewrite_rule('^explore-destinations\/?(.*)','index.php?tt_destination=$matches[1]', 'bottom');...
-1
votes
2
answers
45
views
Regex with start and end that could be different [duplicate]
I am trying to search and replace in VS code thousands of instances, etc.
Sample String:
[[123|123]] and [[4567|4567]], also [[89|89]].
Finding \[\[.*\|(.*)\]\] and replacing with [[$1]]. It finds [[...
-1
votes
0
answers
49
views
Regex for file Names that begin with T- [duplicate]
I want to all files that start with T- and contain only numbers to return a match:
T-123-32.DOCX
But if the file contains letters it does not return a match:
T-12G-XX-X.DOCX
How can I have it ignore ...