- Posted by
- I rather use $ in replacements because you are not limited to max 9 groups (\1 .. \9). You are virtually unlimited using $. I successfully tested groups like $531 and similar high numbers. Unfortunately $ is not allowed as backreference in a Perl regexp itself. At least I don't know the way how to u...Posted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
13:54 - Sep 12
- BTW It can be simplified to: F: ^(.+?\l)(\u.+) R: $2\r\n$1\r\n And Match case is not needed...Posted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
12:33 - Sep 12
- If you remove bold markers then this should work F: ^(.+?\l)(\r\n)?(\u.+) R: $3$2\r\n$1\r\n BR, FleggyPosted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
12:23 - Sep 12
- Hi, I would prefer this Perl regexp because of UTF-8 characters and not only A-Z (\l = any lower character, \u = any upper character) F: \l(\r\n)?\K(?=\u) R: \r\n BR, FleggyPosted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
11:41 - Sep 12
- Hi Edvard, it is not clear how the element c13 (or similar which should be corrected) could look like. I suppose the simplest scenario - there are no nested elements and no EOLs inside the element body. Here is a Perl regexp which finds such lines and remove leading spaces from the body. Find: (?<TA...Posted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
9:18 - Jul 22
- Hello, I suggest a little modification of Mofi's solution: F: (^drop materialized view +)(.+)(\r?\n/\r?\n)(?!drop table \2$) R: \1\2\3drop table \2\3 This regexp checks if the dropping table name is exactly same as the view name, just in case. And the match should start at the beginning of line (sim...Posted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
20:38 - Jun 28
- Just a little note - I suggest to use backreferences for reused matches like date/time field separators in your case. It is more convenient and safer. E.g. Mofi's regexp [12][0-9]{3}-[01][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9] and the modified version [12][0-9]{3}(-)[01][0-9]\1[0-3][0-9] [...Posted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
23:26 - Jan 29
- Hi, I created a new UTF-8 file (Linux EOL) and pasted your sample. Then this Perl regexp Replace All worked fine:| F: .\K R: \n Tested in UE 2023.2.0.22 64-bit for Windows BR, FleggyPosted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
21:24 - Jan 23
- Hi, Because there is no feature to count characters inside the string matched by a Perl regular expression you must consider the worst case when the third column is only one character long so the first added value 0.025 must be preceded by seven spaces. Then the second regexp replace removes the ext...Posted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
21:03 - Jan 23
- Hi Ashyukun, I suppose there are the same characters at the beginning of each line you want to change. If the column number in all such lines is same then you should be able to write a simple perl regexp Find/Replace regardless how much you know about regexes. Find: ^starting_characters.{count_of_sk...Posted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
10:39 - Jan 23
- For example a Perl regexp will help you. Find what: word1|word2 check Highlight all items found click NextPosted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
Dec 08, 2023
- Hi, for example this Perl regexp: (?<!\d)(\d[^\r\n\d]{0,3}){9}\d(?!\d) I limited the maximum count of non-digit chars to 3 but you can adjust it as you wish. I also added lookarounds to check that there are not other digits before and after a match. BR, FleggyPosted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
Jul 05, 2023
- Hi Mofi, AFAIK Notepad++ also uses Boosts library and conditional replace works in it. For example this simple test: F: (lo)|mo R: (?1matched:unmatched) in text hello Mofi -> hel matched unmatched fi :) BR, FleggyPosted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
Jun 16, 2023
- Hi DougEamon, There are many different Perl regexp libraries. UES, UE and some other editors use Boost Perl regexp library which has a different syntax for Replace Conditionals . Unfortunately UE(S) does not support this feature. Conditionals work only in the search pattern. BR, FleggyPosted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
Apr 17, 2023
- Hi Jarva, Mofi's regexes are ok but if you want to use a more exact pattern then the following one (Perl syntax) could be useful. And it also demonstrates the use of DEFINE ;) F: (?(DEFINE)(?<refnum>\d+(?:-\d+)?)) +\[(?&refnum)(?:,(?&refnum))*\] R: <leave it empty> This pattern respects the inner s...Posted in Find/Replace/Regular Expressions
-   Topics
-   Views
- fleggy
Apr 14, 2023