简体   繁体   English

正则表达式替换字符串中的整个字符

[英]regex to replace the entire character in string

the string may have characters like "abc @ xyz 1234-4321", i need regex to replace the characters inside the quoted string with the another string using text replace action in final builder. 该字符串可能包含“ abc @ xyz 1234-4321”之类的字符,我需要使用正则表达式在最终生成器中使用文本替换操作将引号内的字符替换为另一个字符串。

Thanks in advance ,Any help would be appreciable. 在此先感谢您,任何帮助将不胜感激。

".*?" “。*?” will find anything between two ". 将在两个之间找到任何东西。

The dot matches everything, while the * tells it that you want somewhere between zero and many occurences. 点匹配所有内容,而*表示您希望在零到许多次出现之间的某个位置。 You can then just replace it with "yourstring". 然后,您可以将其替换为“ yourstring”。

If you don't want to write "yourstring" you could also use a capture group "(.*?)" but honestly it's overkill for this. 如果您不想写“您的字符串”,则也可以使用捕获组“(。*?)”,但老实说,这太过分了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM