This dead program has been a year since the end of the year, and has been resting for too long in the middle of the New Year. The result is as if it were done twice. For the first time, the document structure of MFC was used in the regular expression tester. In fact, this small program is getting bigger and bigger, and the function is actually a little more.
The current version is using boost. the RegEx li
String segmentation String. Split and Regex. Split, regex. split
String. Split can be used when the String to be cut is a single character.
String strSample = "ProductID: 20150215, Categroy: Food, Price: 15.00 ";String [] sArray
The Regex tester is a pycharm Third-party plug-in that can test regular expressions.
Install regex Tester: setting-"plugins-" Browser repositories-"Enter Regex tester-" Click Install-"reboot Pycharm."
Enter: Click on the Small r
Regular Expressions are mysterious and obscure.
First, you need to systematically learn the knowledge of regular expressions.
In the so-called sense, to do a good job, you must first sharpen the tool. To learn a regular expression, you must test whether the regular expression is correct. So we found the code example ts RegEx tester test function.
The comment on this tool is pretty good.
This little to
Str. Split andRegEx. Split. In my experience, it is a simple replacement of a single string, directly using a string. split ('single string'). Replace multiple strings with RegEx. split (string, @ "multiple strings ",Regexoptions. ignorecase). Here are two examples.Example 1
For example (,),., |, * and other symbols of the class: String area = "(30.13206313822174, 120.4156494140625) (29.87637380707133, 120.1629638671875) (29.882327547852515, 120.50079345703125)"; int t = area. split ("\\)"). length; System. out. println (t); public string [] split (string regex) the parameter name here is regex
A bit of confusion about the split (string regex) method for string classes in Java
This class is described in the JDK Chinese API as follows:
Public string[] split(String regex)
Splits this string according to the match of the given regular expression.
The method acts as if the two-parameter
String [] Split (string RegEx)
Split this string based on the matching of the given regular expression. "//" is required for the RegEx symbol in Java, because RegEx uses "/" as the escape character. In Java, a "/" must be represented.
If "." is used for segmentation, it
The limit parameter controls the number of times the pattern is applied and therefore affects the length of the resulting array. If the limit n is greater than 0, the pattern will be applied up to n-1 times, the length of the array will not be greater than N, and the last item of the array will contain all inputs that exceed the last matching delimiter. If n is not positive, then the pattern will be applied as many times as possible, and the array can be any length. If n is 0, then the pattern w
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.