Find and replace: Greedy regular expressions
See original GitHub issueSpyder version: 2.3.9 OS: Ubuntu 14 Python 2.7
Find and replace doesn’t work for non greedy regular expressions. This regular expression:
\{\$documento\['(.+?)'\]\}
doesnt recognize this text:
{$documento['DOC_CODIGO']}','{$documento['DOC_DOCID_EDP']}','{$documento['DOC_ESTADO']}','{$documento['DOC_BORRADO']}','{$documento['DOC_SAP_CODMATERIAL']}'
But this other regular expressiones does (without the question mark):
\{\$documento\['(\w+)'\]\}
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Greedy and lazy quantifiers - The Modern JavaScript Tutorial
The first thing to do is to locate quoted strings, and then we can replace them. A regular expression like /".+"/g (a quote,...
Read more >Find and replace text using regular expressions - JetBrains
Press Ctrl+R to open the search and replace pane. · Enter a search string in the top field and a replace string in...
Read more >RegEx - find and replace getting too greedy - Stack Overflow
I'm trying to use a RegEx program to edit XML, replacing certain images with their own alt text. Here's what I got. <graphic.*-A.[a-zA- ......
Read more >Python Regex Greedy vs Non-Greedy Quantifiers - Finxter
A greedy match means that the regex engine (the one which tries to find your pattern in the string) matches as many characters...
Read more >Greedy match in MS Word regular expression? - Super User
I try to do that with Word's built-in find and replace using regex. As the desired end of my regular expression is the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@rlaverde, please create a PR based on @aplicacionamedida work.
No prob, thanks to you for reporting it 😃
But please be aware that this only works if you’re using Spyder with PyQt5 (not PyQt4).