|
-
January 19th, 2011, 04:28 AM
#5
Re: A Question Regarding Pattern Matching
 Originally Posted by hadi123
I can do it with split and other methods but this is just a part of
a statement and doing this with pattern matching would be a LOT easier .
If you only have that simple pattern (series of characters of arbitrary length separated by a -) the solution proposed by ProgramThis is perfect. Using the split method you are actually using a regular expression and you will get all the matching groups in an array. I don't know why you believe it would be a lot easier with regular expressions, when you have to do what split does for you. I do use regular expressions quite often, so I know what I'm talking about.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|