what is this means?
This regular expression is made to capture fully formed chains (^ assert start of subject and $ assert end of subject) from one or more sub-pattern delimited by the external round brackets followed by the plus sign ( sub-pattern )+.
The sub-pattern includes two alternative sub-patterns (the vertical bar characters separates alternative sub-patterns) the first (\w+) capture one or more "word" character and the second capture one backslash (the \ preceding an other \ specify that the second one stands for itself) followed by any character (the point .). But this last sub-pattern seems very strange ???
See for example this ECMAScript regular expressions pattern syntax page
Otherwise, it would be more efficient to specify the patterns you want to capture, to build an adapted regular expression...
EDIT : Then this expression capture the string : 'John\jPaul\p' as evidenced by this test :
The match method result is an array of all captured patterns and sub-patterns. Then the patterns seems to be captured many times...
// Remark : the captured backslash do not appears with the alert
Last edited by 007Julien; 08-13-2013 at 08:01 AM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread