Quantcast
Channel: Active questions tagged regex - Stack Overflow
Browsing all 2110 articles
Browse latest View live

Extracting Data from Unique Websites [closed]

So I am currently trying to extract data from many different unique websites using Bs4, Playwright, requests and most other web scrapping libraries in Python.Of course the issue being that the HTML...

View Article



Python not finding carriage returns (^M or \r) visible to nano and vi

I am currently writing a bash script that returns the output of the functions it performs as a log file. When this is viewed in Notepad text showing the process of a function takes up the bulk of the...

View Article

How validate number fields with validateRegex in a JSF-Page?

In a managed bean I have a property of the type int. @ManagedBean@SessionScopedpublic class Nacharbeit implements Serializable {private int number;In the JSF page I try to validate this property for 6...

View Article

jflex specification file; formulating a REGEX expression that is both not...

i am writing a simple .lex file for jflex (with cup) to specify rules for an imaginary language.in this language, a comment is a sequence of characters that begins with /* followed by any characters...

View Article

Split by regex containing one entire string or another in Python

I'm attempting to parse a log file, where each line starts with one of: [DEBUG], [INFO], [WARNING], or [ERROR].I would like to parse this into a list where each element contains one log message,...

View Article


add space between number and string python [closed]

I want to add space between number and text Example string: ABC24.00XYZ58.28PQRoutput: ABC 24.00 XYZ 58.28 PQRPlease let me know the answers.Thanks a lot.

View Article

grep - RegEx multiple-criteria select

Given a file containing this string:IT1*1*EA*VN*ABC@SAC*X*500@REF*ZZ*OK@IT1*1*CS*VN*ABC@SAC*X*500@REF*ZZ*BAR@IT1*1*EA*VN*ABC@SAC*X*500@REF*ZZ*BAR@IT1*1*EA*VN*ABC@SAC*X*500@REF*ZZ*OK@The goal is to...

View Article

Extract and replace text matching multi-line pattern after keyword

I am trying to transform a yaml document in order to make it easier to parse later in my project. I have output that looks like this:I want to use regex to find all occurrences of: Export: Name:...

View Article


How to parse a duration string into seconds with Javascript?

I'm trying to parse a user input string for duration (into seconds) with Javascript. Here are some example inputs that I'd like to be able to deal with:"1 hour, 2 minutes""1 day, 2 hours, 3 minutes""1d...

View Article


Should regular expressions be avoided for performance reasons?

We are often told that regular expressions are slow and should be avoided whenever possible.However, taking into account the overhead of doing some string manipulation oneself (not talking about...

View Article

Python To extract text around a target word using regex [duplicate]

I wonder if there is any way to use regex to extract, let' say', the first and last 5 words around a target word in a new column using pandas in Python.For example, I would like to extract the first...

View Article

Cypher query regex in return

In my Neo4J-DB I have nodes which contain a property {:text} which is html.I would like to return the href-attribute of the -tags which are contained in the {:text}-property.So, I don't want to find...

View Article

How to pass forward slash (%2F) in laravel 5 url with additional get parameters

Users can search my site. Sometimes they might use a search term containing a forward slash (search with / slash) which when submitted by the form turns into %2F in the url.For...

View Article


Combine inner regexes into one and only match if all inner regexes are...

I have a number of regexes I'm using individually to match sections of a string. I want to combine my regexes together in such a way that if ALL of the inner regexes are satisfied then it'll produce...

View Article

How does regular expression engine parse regex with recursive subpatterns to...

This regular expression matches palindromes:^((.)(?1)\2|.?)$Can't wrap my head around how it works.When does the recursion end, and when regex breaks from the recursive subpattern and goes to "|.?"...

View Article


Opensearch / Elasticsearch tokenizer to split on trailing state abbreviation...

I want Opensearch to tokenize transaction information from my bank for a personal project, but I'm unable to determine the right syntax.Here are some examples of transaction descriptions:amazon web...

View Article

Image may be NSFW.
Clik here to view.

How can I use regex to remove unnecessary white spaces and make paragraphs...

I have these paragraphs, and here is what I currently have (the example exists in regex101)And this is what I'm looking to achieve (the example exists in regex101)Rules for the regex that I want (it...

View Article


How to find "" tag from the string with JAVASCRIPT/ regular expression

I need to validate the incoming string for text <script. Example:string a = "This is a simple <script> string";Now, I need to write a regular expression that will tell me whether this string...

View Article

Regular expression negative lookbehind for multiple values [closed]

I want to search my logs for exceptions. Starting Regex:\wException\b(The \w is so that I'm catching names of exceptions e.g. InvalidOperationException, and not just the word "exception", and the \b is...

View Article

How to determine if a string is a valid variable name?

I'm looking for a quick way (in C#) to determine if a string is a valid variable name. My first intuition is to whip up some regex to do it, but I'm wondering if there's a better way to do it. Like...

View Article
Browsing all 2110 articles
Browse latest View live




Latest Images