Skip to content

Tag: regex

regex convert to object

I’m trying to get the value as regex as follow: But I can get the only single value such as “fixed-address” and “host2name”. In “domain-name-servers” I did with “,” in regex. But I think it isn’t the right way because the values are not same count. C…

Regex to get part of the string after dot and before hyphen?

I’m new to regex and have tried to get the regex expression in Python for the following string but still no luck. Just wondering if anyone know the best regex to get group1 from: Basically, I was trying to get the part of string after the first dot and before the second hyphen Answer You can just do it …

Reading accounting information with regex

Context In my daily job I lost a lot of time putting values in excel from a balance sheet manually, so I start learning how to code in python to speed up my work. Problem I am trying to create a regex that is able to detect the value of one account and send me the money that the account

Regex Help for text/pattern between two keywords

I am trying to extract text between two words. The below pattern repeats itself with modifications in between ‘start keyword’ and ‘end keyword’ across the text document. The document has paragraphs and text before and after the following patterns, which i don’t want to extract. C…

Extract subtring using regex python

Hello I have this string and I need extract from this some sub strings according some delimiters: And I need extract exactly this strings: I have tried a lot of types: re.findall, re.search, re.match. But I never geted the result expected. For eg: this code bellow print all string: Answer You do not need a re…

Regex find hash comments exclude curly brackets

I want to find the hash comments that don’t contain the text inside curly braces. But if it starts with #, it’s all comments. Input: Output: I want to be able to achieve what I want with one line of regular expression. Currently I can only find all strings starting with # by {.*?}(*SKIP)(*F)|#[^#{…