Remove text (& brackets) from a string with regex

前端 未结 2 524
北荒
北荒 2021-01-28 03:47

It\'s easy when you understand...unfortunately, I don\'t! I will deeply appreciate you if you can guide me to the answer, thanks.

I want to capture a string, using just

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-28 04:11

    Your Regexp would look something like that. The acutal Syntax depends on your programming language / tool.

    First you need to match the part. Then you capute everything upto (. then to be sure match everything in brackets followed by .

    /].*>\([^(]*\)(.*)/
    

    You should read the Book: Mastering Regular Expressions by Jeffrey Friedl.

提交回复
热议问题