Regex Match Any Character Between (Inclusive) {}

user2994682

In C#, how can I match any/every character (",[,],{,}, ,Az-Zz,0-9,-,+,*,\,\,/,//,...) between the first starting '{' and the last '}'?

Sample String: test{abc123-.//"\"\t+*(E WB"T":) {@}[3]$#@}test

Result: {abc123-.//"\"\t+*(E WB"T":) {@}[3]$#@}

all characters before the first and last {} is removed.

Barmar

This regexp should do it:

\{.*\}

You need to escape { and } because it has special meaning in a regular expression.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Java Regex match anything that matches given pattern and is not between a given character

분류에서Dev

Regex match for starting character or _\w

분류에서Dev

How to match any content between two strings?

분류에서Dev

grep: regex only for match anything between parenthesis

분류에서Dev

Regex replace - match and empty all lines not containing a specific character

분류에서Dev

JS: Adding a space between Japanese character phrase and number using regex

분류에서Dev

Regex to match words separated by '!' and enclosed between curly brackets '{' '}'

분류에서Dev

regex - How to match elements while ignoring others between quotation marks?

분류에서Dev

adding some elements to edittext i.e some character between any word

분류에서Dev

Join two lines in a text file in Unix based on regex pattern matching by removing the newline character in between

분류에서Dev

Regex with multiple character separator

분류에서Dev

Regex to match "a string of length less than X resides between two ">" symbols"

분류에서Dev

Regex: match "group3.*group1" if group2 is not between groups 3 and 1

분류에서Dev

regex (?!) and (?=) and null match

분류에서Dev

Regex multiline match

분류에서Dev

Match regex with \\n in it

분류에서Dev

Regex match tag with no spaces

분류에서Dev

Regex match for split

분류에서Dev

Regex to match URL in Powershell

분류에서Dev

Regex to match end of the word

분류에서Dev

.match() problems with regex

분류에서Dev

add apostrophe to regex match

분류에서Dev

RegEx to match list

분류에서Dev

Regex match in jQuery

분류에서Dev

Regex ignoring first character if it's a $

분류에서Dev

Regex end when character appears

분류에서Dev

Vim regex - hex character in replacement?

분류에서Dev

Regex match everything after conditional match

분류에서Dev

Python Regex match: include Regex syntax

Related 관련 기사

  1. 1

    Java Regex match anything that matches given pattern and is not between a given character

  2. 2

    Regex match for starting character or _\w

  3. 3

    How to match any content between two strings?

  4. 4

    grep: regex only for match anything between parenthesis

  5. 5

    Regex replace - match and empty all lines not containing a specific character

  6. 6

    JS: Adding a space between Japanese character phrase and number using regex

  7. 7

    Regex to match words separated by '!' and enclosed between curly brackets '{' '}'

  8. 8

    regex - How to match elements while ignoring others between quotation marks?

  9. 9

    adding some elements to edittext i.e some character between any word

  10. 10

    Join two lines in a text file in Unix based on regex pattern matching by removing the newline character in between

  11. 11

    Regex with multiple character separator

  12. 12

    Regex to match "a string of length less than X resides between two ">" symbols"

  13. 13

    Regex: match "group3.*group1" if group2 is not between groups 3 and 1

  14. 14

    regex (?!) and (?=) and null match

  15. 15

    Regex multiline match

  16. 16

    Match regex with \\n in it

  17. 17

    Regex match tag with no spaces

  18. 18

    Regex match for split

  19. 19

    Regex to match URL in Powershell

  20. 20

    Regex to match end of the word

  21. 21

    .match() problems with regex

  22. 22

    add apostrophe to regex match

  23. 23

    RegEx to match list

  24. 24

    Regex match in jQuery

  25. 25

    Regex ignoring first character if it's a $

  26. 26

    Regex end when character appears

  27. 27

    Vim regex - hex character in replacement?

  28. 28

    Regex match everything after conditional match

  29. 29

    Python Regex match: include Regex syntax

뜨겁다태그

보관