Questions tagged [regex]

Regular expressions provide a declarative language to match patterns within strings. They are commonly used for string validation, parsing, and transformation. Since regular expressions are not fully standardized, all questions with this tag should also include a tag specifying the applicable programming language or tool. NOTE: Asking for HTML, JSON, etc. regexes tends to be met with negative reactions. If there is a parser for it, use that instead.

Filter by
Sorted by
Tagged with
2
votes
1answer
56 views

How to validate regex based Resume parser efficiently

I am using rule based logic to extract features from resume. Basically I am trying to find if the candidate switched the company in less than 1 year. So I have the code in place to find it using ...
1
vote
1answer
21 views

Is the search for a specific n-gram the same like a string search?

Is the result of a search for a specific n-gram like sherlock+holmes equal to the result of a regex search for "sherlock holmes" in the same document corpus? So if i read about n-grams for certain ...
1
vote
1answer
30 views

How to generate abbrevations from shortend words in medical records

I have text files which contains medical history of a patients and would want to extract information out of it. Basically what want is generate english text of abbrevations,semantic category region,...
1
vote
2answers
58 views

How to improve regex while fetching record dynamically

The data is as follows: COL1 COL2 12 :402:agsh,hhjd,:45:hghgh,gruru,:12:fgh,ghgh,:22:hhhh 57 :42:agshhhjd,:57:hghgh,gruru,:120:fghghgh,:12:hhhhhh I ...
1
vote
2answers
21 views

Keeping part of a string in R [closed]

I have a dataframe with the following column city <- c("Sydney NSW", "Newcastle NSW", "Liverpool NSW", "Broken Hill NSW") I want to maintain everything prior ...
0
votes
2answers
170 views

Replace method in pandas not giving expected result

I have data as below: 123.12.23.2 110.22.21.23 I want to mask this data as below one 1xx.xx.xx.x So I tried below code : ...
0
votes
1answer
50 views

How to filter out a portion of the text data with re.match or any other regex method with Python?

I have the following data : ...
3
votes
3answers
584 views

Machine learning or NLP approach to convert string about month ,year into dates

I'm currently in the process of developing a program with the capability of converting human style of representing year into actual dates. Example : last year last month into December 2018 string may ...
1
vote
0answers
159 views

simplifying AND OR Boolean Expression [closed]

My problem is turning a string that looks like this. "a OR (b AND c)" into a OR bc if the expression is like ...
1
vote
1answer
101 views

Tagging Unix/Non-Unix logs using NLP

I have a set of unstructured data consisting command output logs for different operating systems like Unix, Windows, etc. For example: Releasing version 0.0.1 for Stackoverflow, on 01/01/2019. The ...
4
votes
1answer
363 views

Regex-style pattern-matching for time series

This is more of a "what technology/library would you use for this?" question than anything else. I have categorical time series data, and need to match cases in these time series to known patterns. ...
4
votes
1answer
156 views

How to automatically verify official documents?

I am new to machine learning and data science. I apologise if the question seems very basic. I have a requirement where I need to verify information submitted via a form with the corresponding ...
4
votes
2answers
10k views

regex to remove repeating words in a sentence

I am new to regex. I am working on a project where i need to replace repeating words with that word. for example: I need need to learn regex regex from scratch. I need to change it to: I need ...
2
votes
1answer
1k views
2
votes
1answer
244 views

Facing a difficult regular expression issue in cleaning text data

I am trying to substitute a sequence of words with some symbols from a long string appearing in multiple documents. As an example, suppose I want to remove: ...
0
votes
1answer
1k views

Regex remove 1-2 character sequences: hyphens literal, not word boundaries [closed]

I need a regex in R to exclude 1 or 2-character words, but which does not treat hyphens as word boundaries. Here is an example: ...
2
votes
1answer
4k views

How to improve OCR (Scanning) results?"

Below is text output obtained after ocr image to string of medical discharge summary report. ...
0
votes
3answers
342 views

Using training data generated with pure regular expressions - Can machine learning surpass the accuracy of your regular expression?

For text classification with machine learning - If your training data was generated purely with regular expressions, is it possible to train a machine learning model with this training data which will ...
2
votes
2answers
1k views

Regular expression in python -

I want to extract the values of the below text ...
3
votes
2answers
2k views

What is the best approach for specified optical character recognition?

I have a quite understandable request of extracting information (invoice number, invoice data, due date, total etc.) from scanned invoices (the digital format is image, not PDF), preferably in Python. ...
1
vote
1answer
4k views

R: remove single characters from string

I have a huge string in R where I want to remove single characters from. So for example, the string might be blabla a test this that b á And the result should be ...
1
vote
1answer
819 views

Using regex in redshift to find dollar values

I have a field in a Redshift table that has user-generated text. The field is where users can say how much they think something costs. Ideally it'd just be a decimal, but it's varchar. So users can ...