Skip to content Skip to sidebar Skip to footer
Showing posts with the label Regex

Python Regex To Match Yaml Front Matter

I'm having trouble crafting a regex to match YAML Front Matter This is the front matter I was t… Read more Python Regex To Match Yaml Front Matter

Regex To Extract Mentions In Twitter

I need to write a regex in python to extract mentions from Tweets. My attempt: regex=re.compile(r&#… Read more Regex To Extract Mentions In Twitter

Python - Remove A Character The Second Time It Is Duplicated

I'm looking to remove a ',' (comma) from a string, but only the second time the comma o… Read more Python - Remove A Character The Second Time It Is Duplicated

Grab First Word In String After '\id'

How would I grab the first word after '\id ' in the string? string: '\id hello some ran… Read more Grab First Word In String After '\id'

Regex Help Needed To Match Numbers

I am an absolute noob at regex and need to help to match numbers in this format: 1,234,567 or 12… Read more Regex Help Needed To Match Numbers

Match Filenames To Foldernames Then Move Files

I have files named 'a1.txt', 'a2.txt', 'a3.txt', 'a4.txt', 'a5.… Read more Match Filenames To Foldernames Then Move Files

Searching For A Specific Phrase In Csv File Using Regex In Python

I have a csv database of tweets, which I need to search for a list of specific phrases and words. … Read more Searching For A Specific Phrase In Csv File Using Regex In Python

Extract Business Titles And Time Periods From String

I am extracting information about certain companies from Reuters using Python. I have been able to … Read more Extract Business Titles And Time Periods From String

Re-use Of A Regular Expression Capture Group In Python

The following python code does work but the regular expression 'search' is evaluated twice… Read more Re-use Of A Regular Expression Capture Group In Python

Invalid Value After Matching String Using Regex

I am trying to match strings with an addition of 1 at the end of it and my code gives me this probl… Read more Invalid Value After Matching String Using Regex

Find And Count Instance Of Substring Within Multiple Strings Using Python

I have a sql query within python with multiple sub-queries. So the set up is multiple substrings wi… Read more Find And Count Instance Of Substring Within Multiple Strings Using Python

Split Documents Into Paragraphs

I have a large stockpile of PDFs of documents. I use Apache Tika to convert them to text, and now I… Read more Split Documents Into Paragraphs

Combining For Loop Iterations Into A Single Line And No Match Handling

Probably a very basic question but hoping someone can help out. I have the following: query = ['… Read more Combining For Loop Iterations Into A Single Line And No Match Handling

How To Replace Parenthesis And Text Within It In Python String

I have two strings like this. string1 = 'Today I went to the (market) to pick up some (fruit).&… Read more How To Replace Parenthesis And Text Within It In Python String

How To Split At Spaces And Commas In Python?

I've been looking around here, but I didn't find anything that was close to my problem. I&#… Read more How To Split At Spaces And Commas In Python?

Regex Sre_constants.error: Bad Character Range

I'm trying to a get a JSON string from another string with this regex: YAHOO.Finance.SymbolSugg… Read more Regex Sre_constants.error: Bad Character Range

Regular Expression To Match 3 Capital Letters Followed By A Small Letter Followed By 3 Capital Letters?

I need a regular expression in python which matches exactly 3 capital letters followed by a small l… Read more Regular Expression To Match 3 Capital Letters Followed By A Small Letter Followed By 3 Capital Letters?

How Do You Parse And Match The Keyword In Search Engine Url Using Python Re Module?

Example from Google: http://www.google.com.co/url?sa=t&rct=j&q=pedro%20gomez%20proyecto%20e… Read more How Do You Parse And Match The Keyword In Search Engine Url Using Python Re Module?

Python Regex To Match Currency With Or Without Comma Or Decimal

How to write regex that can 1. match currency which may or may not include a comma or decimal and 2… Read more Python Regex To Match Currency With Or Without Comma Or Decimal

Regex Taking Too Long In Python

I have used regex101 to test my regex and it works fine.What i am trying to is to detect these patt… Read more Regex Taking Too Long In Python