regexp-replace

regex: how to replace all occurrences of a string within another string, if the original string matches some filter

寵の児 提交于 2021-01-27 19:12:15
问题 i need to replace all occurrences of a string within another string, if the original string matches some filter i can only use a single regex using an s command, because i need to send the assembled command to a 3rd party API i have tried to use positive lookahead as to not consume the string in which i want to replace characters, but somehow i can not get the replacing to work as expected. here is what i have tried so far and what was the outcome: (note that the filter - here [0-9]+ is just

extract serial from string that follow fuzzy pattern SQL Netezza

谁说我不能喝 提交于 2021-01-07 03:08:31
问题 please I Have a log message that contains a serial with a fuzzy pattern that hard to follow like the below |LogMsg | |------------------------------------------------------------------------------------------| |Customer Receive CPE Indoor. serial 21530369847SKA011094, user:ahmed.o.haraz | |Customer Receive CPE Indoor as change. serial :21530369847SK9078291, user:Abdullah.M160275| |Customer Receive CPE Indoor. serial:ZTERRT1H9202990 | |Customer Receive CPE Indoor. serial 21530369847SKB333996

extract serial from string that follow fuzzy pattern SQL Netezza

北慕城南 提交于 2021-01-07 03:07:52
问题 please I Have a log message that contains a serial with a fuzzy pattern that hard to follow like the below |LogMsg | |------------------------------------------------------------------------------------------| |Customer Receive CPE Indoor. serial 21530369847SKA011094, user:ahmed.o.haraz | |Customer Receive CPE Indoor as change. serial :21530369847SK9078291, user:Abdullah.M160275| |Customer Receive CPE Indoor. serial:ZTERRT1H9202990 | |Customer Receive CPE Indoor. serial 21530369847SKB333996

Windows batch/powershell file to regex find and replace only in files having specific text [closed]

那年仲夏 提交于 2021-01-07 02:31:45
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed yesterday . Improve this question How could I make a Windows batch file to find and rename with regex in files, that have specific text in them? This is the needed scenario: If file path is C:\Folder\ and file name is something_*.xml (wildcards allowed) and the file has specific text