In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Xiaobian to share with you how to use regular expressions to replace the special characters in the report name, I believe most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article. Let's take a look at it!
Regular expression, also known as regular expression. (English: Regular Expression, often abbreviated as regex, regexp or RE in code), a concept in computer science. Regular tables are often used to retrieve and replace text that conforms to a certain pattern (rule).
Many programming languages support string manipulation using regular expressions. For example, there is a powerful regular expression engine built into Perl, as well as that of the java language. The concept of regular expressions was first popularized by tools in Unix, such as sed and grep. Regular expressions are usually abbreviated to "regex". The singular has regexp and regex, and the plural has regexps, regexes, and regexen.
/ / the expression object Pattern p = Pattern. Compile ("[\?\ *\:\\ [\]\]); / / create the Matcher object Matcher n = p.matcher (systemName); Matcher m = p.matcher (unitCodeName); / / replace String sheetNameSystem = n.replaceAll ("); String sheetNameUnit = m.replaceAll (")
Let's take a look at Java regular expressions to replace all special characters.
The Java regular expression replaces all special characters as follows:
/ * regular replacement of all the special characters * @ param orgStr * @ return * / public static String replaceSpecStr (String orgStr) {if (nullable construcorgStructs! "" .equals (orgStr.trim () {String regEx= "[\\ s`!! @ # ¥$% ^. & * ()\--\-_ = + [\\ [] {}\\ |,\;;:'"\ ",", /? ?] "; Pattern p = Pattern.compile (regEx); Matcher m = p.matcher (orgStr); return m.replaceAll (");} return null;} is all the content of the article" how to use regular expressions to replace special characters in report names ". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.