How to replace a value after a statement?
-
I want to replace a number that comes after a statement, more specifically: factor = “number” [without the "]. Is there any way how I can replace all numbers after factor = without doing it manually? For example, I want to replace all numbers that come after factor = with 40, the numbers after factor = are completely random, is there any way how to automatically replace it?
-
Yes, you could try:
Find what zone:
(?-i)factor = \d+
Replace with zone:factor = 40
Search mode: Regular expressionThe
(?-i)means the case of what follows is important to the match – in this case it means thatfactorwill match butFACTORorFactoror … will NOT match. If the case offactordoesn’t matter to you, you can use(?i)instead.The
\d+part means that at that location in a potentially matching string, a series of one or more digit characters must occur for the match to be “made” and consequently replaced by the replace-with text. -
Thank you so much, you are a saviour
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