How to parse a command line with regular expressions?

后端 未结 13 679
离开以前
离开以前 2020-12-03 16:02

I want to split a command line like string in single string parameters. How look the regular expression for it. The problem are that the parameters can be quoted. For exampl

相关标签:
13条回答
  • 2020-12-03 16:36

    If its just the quotes you are worried about, then just write a simple loop to dump character by character to a string ignoring the quotes.

    Alternatively if you are using some string manipulation library, you can use it to remove all quotes and then concatenate them.

    0 讨论(0)
提交回复
热议问题