essaytee
Need a good one-liner.
- Local time
- Today, 23:32
- Joined
- Oct 20, 2008
- Messages
- 546
Ok, I first went the ChapGPT route for the solution but I haven't got it working. What I want to do is replace all my error handling routines with standard code snippets. For some of my functions, across many modules, I have "On Error Goto Err_SomeFunctionName" and I have the corresponding label towards the end of the function "Err_SomeFunctionName:" I want to replace with "On Error Goto Error_In_Code" and the label to be "Error_In_Code:"
For what it's worth, here's a link to my ChatGPT back'n'forth.
From ChatGPT I got it as far as the code matching "On Error Goto Err_SomeFunction" but that portion of code was within a commented out line, but it didn't recognise the true code at the top of the function, not indented and not commented out.
Here is the reg ex that that I finally got to:
Any suggestions?
For what it's worth, here's a link to my ChatGPT back'n'forth.
From ChatGPT I got it as far as the code matching "On Error Goto Err_SomeFunction" but that portion of code was within a commented out line, but it didn't recognise the true code at the top of the function, not indented and not commented out.
Here is the reg ex that that I finally got to:
Code:
re.Pattern = "On\s+Error\s+Goto\s+Err_\w+"
Any suggestions?