Regex needed!! Please help
-
Hello guys,
I got this text:
{"attributes":{"_createdAt":1618301958087,"_snowProperties":{"protected":false},"_updatedAt":1618406370533,"description"
I need to replace and the results be like this:
{"attributes":{"description"
Can someone please help?
Thanks for the attention.
-
Assuming you don’t care what’s between the start and the “description” but just want to cut out most of the middle stuff, I think you might want
- FIND =
(\{"attributes":\{).*?("description")
- REPLACE =
$1$2
- Search Mode = Regular Expression
The advice below will help you give more information if this solution wasn’t sufficient for you.
----
Do you want regex search/replace help? Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you. All example text should be marked as literal text using the
</>
toolbar button or manual Markdown syntax. To makeregex in red
(and so they keep their special characters like *), use backticks, like`^.*?blah.*?\z`
. Screenshots can be pasted from the clipboard to your post usingCtrl+V
to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have and the text you want to get from that data; include examples of things that should match and be transformed, and things that don’t match and should be left alone; show edge cases and make sure you examples are as varied as your real data. Show the regex you already tried, and why you thought it should work; tell us what’s wrong with what you do get. Read the official NPP Searching / Regex docs and the forum’s Regular Expression FAQ. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries. - FIND =
-
Thanks!!! You just saved hours of editing!!! :)