Home > Net >  Regular access to the string in one continuous digital divides and leave the other parts
Regular access to the string in one continuous digital divides and leave the other parts

Time:01-31

With the practice of higher efficiency, such as regular, rather than their individual character to judge
Such as an arbitrary string
D123, ABC, and 234

For 123, and part is a front, the back part is a
Output an array
Consists of three elements:
D
123
, ABC, 234

CodePudding user response:

Why 234 not again?
 
\ D + | \ D +

Has found four matching:
D
123
, ABC,
234

CodePudding user response:

reference 1/X - I - n reply:
why 234 not again?
 
\ D + | \ D +

Has found four matching:
D
123
, ABC,
234

As long as the access to the first line

CodePudding user response:

I really don't understand all the time you learn why follow the garden "efficient"

Regular characters one by one to determine efficient than they are, you really what your efficient refers to

"He looks very nice, just one word"
"Internal operations such as fly, he is not one of the characters to decide, in him there is a god, look at will know that as a result, there is no one character decide"

CodePudding user response:

Ask a question to squeeze the
Use (\ D +) (\ D +) (. *)

CodePudding user response:

If it were possible to begin with Numbers directly, with the following:
(\ D? (\ d +) (. *), take the Match results of the Groups

CodePudding user response:

Hand, should be
(\ D *) (\ D +) (. *)
  •  Tags:  
  • C#
  • Related