Now this whole syntax thing makes a lot more sense after a bunch of reading and messing about #Notepad++ regex rearrange code#Thanks for the code i had really no idea were to start just an old dumb welder trying to learn this stuff to help out my wife with her new machine Inside the brackets is the 152 times were looking for the number “8”Ĭould i just use the “+” to make it greedy to the end of the line to grab all of the number"8" ^STIF:8+$ The caret ^ acts as anchor for the front of the line Use the Mark function with the regex ^STIF:8$ Then duplicate the examples in the post but with the changes made so we can more easily see what your intention said in use regex to change number sets:Īs a marker of sorts so that the search could find the numbers That will encapsulate the examples in a black window so we can see the data in it’s natural state (the posting window has a tendency to alter some of the characters as it thinks it is part of the formatting code), this prevents that occurring. Then select all those example lines and click on the button you will see above the posting window. Then insert them into a post in this thread. Then you would use the “F2” (or “Shift-F2”, these are the default) hotkeys to go forward to next (or back to previous) bookmarked line.Īs a suggestion pick about 5-10 lines containing at least 2 (if not more) lines with the STIF lines to be edited in them, along with some other lines. You can use the above to bookmark the lines by ticking the “bookmark lines” when using the “Mark” function, make sure search mode is set to regular expression. However it would seem that you want to replace lines like this with different replacement strings depending on some criteria which you’ve yet to explain. Provided the STIF is against the left margin and that the line ends with the last 8 character. The find string (using regex) to look for this is: If that’s not what you need, please let us know.īut, it is rather frustrating, when trying to extract the real problem is more difficult than providing a solution! said in use regex to change number sets: Where you could vary the 5 in the “repl” expression as you need. So, in the event that what I’ve surmised is true, I would suggest this regular expression replacement (which would work for your second-posting data): This is just a total guess, because I think if it were true you’d have said “there is to always be seven characters in what I want to end up with” Maybe the pattern is that you always want seven characters in the result? The second example shows nine 4 characters being changed to seven 5 characters. In your original example, you show six 8 characters being transformed into seven 9 characters. But we can’t see what you see.Īs an example here of what doesn’t make sense: You need to give us enough before-and-after data for us to derive the pattern.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |