I apologize if there is an answer for this somewhere, but my search skills have failed me if there is.
I'm using UltraEdit and there are lines I need to remove from some JSON schemas to make comparing them easier.
So given the following:
"PaymentMethod": {
"$id": "/properties/PaymentMethod",
"items": {
"$ref": "PaymentMethod.json"
},
"type": "array"
}
Using this RegEx:
^.*\".*\"\: \".*$\r\n
Selects these lines:
"$id": "/properties/PaymentMethod",
"$ref": "PaymentMethod.json"
"type": "array"
What I need to do is skip the $ref line.
I've tried to get negative lookaround to work using (?!json) in various ways with the selection criteria and have failed miserably.
The purpose of this is to delete the selected lines.
Thanks for any help.
Update: To clarify, there are lines I want to delete that match the criteria my Regex finds, but I do not want to delete the $ref line. So I was hoping to find a relatively easy way to do this using straight up perl regex within UltraEdit.
I've created a workaround with a Python script so I can get my work done, but it would still be interesting to find out if there is a way to do this. :)
If you don't want
$refafter the initial quotes:see it here: https://regex101.com/r/yxTwck/1
or to exclude based on
.json"at the end of the line:Also note that you are using greedy quantifiers (
.*vs..*?). If your idea is to have the first.*stop at the first", you should probably use[^\n"]*which will prevent line feeds or"s from being consumed. Your regex matches"""""""""""""" "type": "array", for example.