How to get comments and string in regex?

Member

by lottie , in category: Third Party Scripts , 5 months ago

How to get comments and string in regex?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by lizzie , 5 months 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.

Related Threads:

How to get specific text from a string in regex?
How to get the value in a string using regex?
How to get rid of a portion of a string using regex?
How to get the result of finding string with regex?
How to get "m" meters and "km" from string using regex?
How to replace string before string using regex?