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?

  • @Rathard

    Yes, you could try:

    Find what zone: (?-i)factor = \d+
    Replace with zone: factor = 40
    Search mode: Regular expression

    The (?-i) means the case of what follows is important to the match – in this case it means that factor will match but FACTOR or Factor or … will NOT match. If the case of factor doesn’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