管道正则表达式有可能吗?

时间:2016-06-15 10:04:59

标签: regex

在正则表达式中,一个正则表达式的结果可能是另一个正则表达式的输入。

就像unix / linux中的一个例子,当我们触发命令时:

NSString *urlString = [baseUrlString stringByAppendingString:@"account/avatar"];

    NSDictionary *parameters = @{@"token": self.token};
    NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
    AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];


    NSURL *url = [NSURL URLWithString:@"account/avatar" relativeToURL:self.baseUrl];

    NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] requestWithMethod:@"POST" URLString:urlString parameters:parameters error:nil];
    //[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
    //[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
    NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithRequest:request fromFile:filePath progress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
        if (error) {
            NSLog(@"Error: %@", error);
        } else {
            NSLog(@"Success: %@ %@", response, responseObject);
        }
    }];
    [uploadTask resume];

第一个$ls -l | grep "Aug" 的结果是ls的输入。

0 个答案:

没有答案