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
1
vote
1answer
27 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
51 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
115 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
47 views
3
votes
3answers
421 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 ...
0
votes
1answer
41 views

Remove specific words containing dots from a string

Hi I got words that contain one of the following tokens: CO. PRO. IST. How to clean my words from these tokens? Do you have any regex pattern? for example the words : ...
1
vote
0answers
120 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
72 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
311 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
124 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 ...
3
votes
2answers
8k 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
215 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
330 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
787 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 ...