Regular expression with an = and a ;

前端 未结 5 943
情深已故
情深已故 2021-02-12 15:02

I\'m trying to use a regular expression to find all substrings that start with an equals sign (=) and ends with a semicolon (;) with any number of char

5条回答
  •  我在风中等你
    2021-02-12 15:12

    This looks for "any number of = signs, including 0"

    =*;
    

    If you want "= followed by any number of other characters" you want

    =.*;
    

    However, that will match greedily - if you want lazy matching (so that it stops one group when it finds the next semicolon) you might want:

    =.*?;
    

提交回复
热议问题