Linked Questions
236 questions linked to/from Why it's not possible to use regex to parse HTML/XML: a formal explanation in layman's terms
-1 votes
1 answer
14k views
Replacing xml tag value by regex [duplicate]
I have xml like this and i want to replace carrot tag value by something else i use this expression (<.[^(><.)]+>) but it doesn't work properly what should i change to manage ...
1 vote
2 answers
884 views
Parse HTML in PHP and extract value [duplicate]
I'm trying to extract some information from a website. There is a section looking like that: <th>Some text here</th><td>text to extract</td> I would like to find (with ...
-2 votes
2 answers
881 views
RegEx for capturing children attribute values of the first parent [duplicate]
I'm parsing a XML file with nodejs and RegExp, but i don't find the way to extract all children from a parent, for example i need all FormalName="(.+)" from parent PARENT1 <TopicSet FormalName="...
-1 votes
1 answer
1k views
regex to find xml element & replace [duplicate]
I have a xml file with this data format <row Id="9" Body="aaaaaaaaa" Target="123456" /> I want to find & replace all Body="" things with a space from my xml file. What is the regex for ...
0 votes
1 answer
853 views
Regex to match all non-escaped double quotes in XML string [duplicate]
I've got a json payload from a 3rd party RESTful service. So right off the bat, please don't reply with "tell the vendor to fix it", because I already tried. The issue is that one of the fields is an ...
-1 votes
1 answer
1k views
Regexp extract XML attribute value [duplicate]
please, advice how to get xml attribute value with regexp python style. Here is the example, the extract has to be full match(long story) <method code="ABC"> the most I achieved is (?<=...
0 votes
3 answers
454 views
How to truncate extraneous output using shell script? [duplicate]
I am trying to eliminate everything before and after the JSON contained in a specific part of a webpage so I can send that to a PHP script. I've tried a number of ways to get rid of the container ...
-2 votes
1 answer
662 views
Extract string from XML with regex [duplicate]
I have the xml as text. I need to extract the string "20" between the tags: <ans:sequencialTransacao>2020</ans:sequencialTransacao> I have tried the script below, but it doesn't ...
0 votes
0 answers
904 views
RegEx to replace namespace in XML [duplicate]
I need to replace namespace with some value private static String REGEX1 = "(<\\/?)[ns2]+?:"; private static String INPUT = "<ns1:fso xmlns:ns2='https://www.example.com/fsoCanonical'&...
-2 votes
1 answer
386 views
matching regex ignoring whitespace and new lines [duplicate]
I have an xml string that looks something like <parent><child>value</child></parent> I’m trying to write a regular expression that matches this string. Trick is, sometimes the ...
-2 votes
1 answer
498 views
Extracting all XML namespaces in an XML without parsing the XML file [duplicate]
I have an XML request, the objective is to extract only the XML namespace. <s:student xmlns:s="http://www.way2tutorial.com/some_url1" xmlns:res="http://www.way2tutorial.com/...
-2 votes
1 answer
391 views
Bash: Best way to get all string matches with grep in string [duplicate]
I'm having some troubles finding a way to get all matched values from string. I have XML string stored in a variable. From that variable I extract a string with grep. That works well for one match but ...
-1 votes
1 answer
480 views
Python regex in xml text, find tags [duplicate]
I'm working on a project using Python to search the XML of a research paper, searching for a particular string. I've accomplished this, but I need to get the search result's most previous section ...
0 votes
1 answer
250 views
SED multiline search and replace error [duplicate]
I have an XML file (config.xml) as below. <?xml version="1.1" encoding="UTF-8"?> <project> <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> <...
0 votes
0 answers
397 views
Regex pattern to match and replace a group of x whitespaces before a xml tag with a tab [duplicate]
Note: Just to clear the confusion, I have a parsed XML as String that I would like to apply regex against. Mention of XML in my question simply refer to parsed XML string. I have a XML string ...