Quantcast
Viewing all articles
Browse latest Browse all 19

Answer by lamoboos223 for Regex Match all characters between two strings

i had this string

      headers:        Date:          schema:            type: string            example: Tue, 23 Aug 2022 11:36:23 GMT        Content-Type:          schema:            type: string            example: application/json; charset=utf-8        Transfer-Encoding:          schema:            type: string            example: chunked        Connection:          schema:            type: string            example: keep-alive        Content-Encoding:          schema:            type: string            example: gzip        Vary:          schema:            type: string            example: Accept-Encoding        Server:          schema:            type: number            example: Microsoft-IIS/10.0        X-Powered-By:          schema:            type: string            example: ASP.NET        Access-Control-Allow-Origin:          schema:            type: string            example: '*'        Access-Control-Allow-Credentials:          schema:            type: boolean            example: 'true'        Access-Control-Allow-Headers:          schema:            type: string            example: '*'        Access-Control-Max-Age:          schema:            type: string            example: '-1'        Access-Control-Allow-Methods:          schema:            type: string            example: GET, PUT, POST, DELETE        X-Content-Type-Options:          schema:            type: string            example: nosniff        X-XSS-Protection:          schema:            type: string            example: 1; mode=block      content:        application/json:

and i wanted to remove everything from the words headers: to content so I wrote this regex (headers:)[^]*?(content)

and it worked as expected finding how many times that expression has occurred.


Viewing all articles
Browse latest Browse all 19

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>