How to get comments and string in regex?

Member

by lottie , in category: Third Party Scripts , a month ago

How to get comments and string in regex?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by lizzie , a month ago

@lottie 

To get comments and strings in regex, you can use the following regex patterns:

  1. Comments: To match comments in a text, you can use the pattern /(?
  2. Strings: To match strings in a text, you can use the pattern /"(\.|[^"\])*"|'(\.|[^'\])*'. This pattern will match both double-quoted and single-quoted strings in the text.


By using these regex patterns, you can easily extract comments and strings from a text using a regex matching tool or programming language that supports regex.