Search & Replace syntax
-
Hello, I am trying to find and replace but I’m having trouble with it as I’m not good at computers.
Here is the data I currently have (“before” data):
SelectSpells(c213ca01-3767-457b-a5c8-fd4c1dd656e2,1,1)Here is how I would like that data to look (“after” data):
SelectSpells(c213ca01-3767-457b-a5c8-fd4c1dd656e2)Sometimes there is something after the two digits. What I need to delete are the two digits so that it looks like this at the end
SelectSpells (StringsOfNumbers)To accomplish this, I have tried using the following Find/Replace expressions and settings
- Find What =
SelectSpells[^>]\d,\d
SelectSpells[^],[0-9],[0-9]
SelectSpells[\a+][\d 0-9],[\d 0-9]
And many more I don’t remember - Replace With = None yet.
- Search Mode = Regular Expression
- Dot Matches Newline = I don’t know what that is, sorry
I thought it would work because my friend who’s better at computer thought it would as we’re checking the user manual, but we’re stumped
I’d appreciate any help, thanks
- Find What =
-
You probably want something like this:
Find what:
^(SelectSpells\([\d\-abcdef]+),\d+,\d+
Replace with:$1That is making a few assumptions:
-
That “SelectSpells(” always starts at the beginning of a line, with nothing (not even blanks) before it, and it’s immediately followed by the id number you want to keep.
-
That the id number is always made up of some combination of digits, the letters a-f, and hyphens.
-
That the part you want to remove is always a comma, one or more digits, a comma, and one or more digits. No blanks, no extra commas, no letters or hyphens or anything else.
-
That once you remove that, if there is anything after the two commas and numbers, you want to keep all of it.
If one of those assumptions is not true, you’ll have to explain more precisely what is true.
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login