Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8309535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:08:55+00:00 2026-06-08T19:08:55+00:00

I am working on regular expressions but where ever I search I am getting

  • 0

I am working on regular expressions but where ever I search I am getting the code and explanation for validating the email now I have to do something like this

Contents of the file are like this(file formate may be .rtf, .txt …etc)

[Title:languageC]
[Author:Dennis Ritchie]
[Description:this book is nice to learn the C language]

form this file now I want to extract the languageC, Dennis Ritchie, this book is nice to learn the C language. I have achieved this by using NSStrings, NSScanner and NSRange but now I want to achieve this same using regularexpressions is it possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T19:08:57+00:00Added an answer on June 8, 2026 at 7:08 pm
    NSString *regexStr = @"\[Title:([.]+)\][ ]+\[Author:([.]+)\][ ]+\[Description:([.]+)\]";
    
    NSError *error;
    NSRegularExpression *testRegex = [NSRegularExpression regularExpressionWithPattern:regexStr options:0 error:&error];
    
    if( testRegex == nil ) NSLog( @"Error making regex: %@", error );
    
    NSTextCheckingResult *result = [testRegex firstMatchInString:test options:0 range:NSMakeRange(0, [test length])];
    
    NSRange range = [result rangeAtIndex:1]; // This will give you Title,
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some regular expressions help. So far I have my code working to allow
I have a lot of problems getting regular expressions working for my simple Cocoa
I am working with regular expressions to transform HTML into BBCODE. But, with code
I am working on a piece of code which uses regular expressions in c.
I really need some help in Regular Expressions, i'm working on a function like
I'm working with regular expressions (Regex) but not finding the exact output. I want
I'm relativly new to regular expressions but I managed to create a working expression
I'm stuck. I tried it with regular expressions, but I guess I'm missing something.
I'm working on a regular expressions pattern, but it contains a number of special
I've been struggling with getting a working regular expression for a little project of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.