Home > Net >  C # regex. The split () string
C # regex. The split () string

Time:03-31

See other people's code, don't know how the string is split, big trouble to solve, thank you!

Var str_eaxm=Regex. Split (sExample_str, "[' \] * [], [] * [' \]"). ToList ()

Hope leaders can give me answers, this sentence is what meaning, especially in the middle of this a few symbols,

CodePudding user response:

Regular expression character segmentation
The second parameter of the so-called several symbols is a regular expression
Reference: https://www.runoob.com/regexp/regexp-syntax.html

CodePudding user response:

Matching
', '
Or
', '

CodePudding user response:

With ' or " beginning at the end of the middle there is a , and

Columns such as
', '
", "
', "
Can be matched

CodePudding user response:

Var str_eaxm=Regex. Split (sExample_str, "[' \] * [], [] * [' \]"). ToList ()

Remove after the escape character, regular expressions are as follows:
[' "] * [], [] * [' "]

[] said scope, the matching between any content of a
[' "] can match a single or a double quote
[] * among only a space, space, only * number of 0 ~ up, can be any number of Spaces, including 0 (no Spaces)
, basic text, comma
[] * among only a space, space, only * number of 0 ~ up, can be any number of Spaces, including 0 (no Spaces)
[' "] can match a single or a double quote

This is your interpretation of the expression
To:
", "
", "

', '
', "
As a delimiter text segmentation
Can use this expression to optimize
[' ['] *, "*"]
  •  Tags:  
  • C#
  • Related