2

I have a dataset of resume and I want to extract data from each resume I will give an example as a sample to what I need

String test= "Worked in Innovision Information System Private Limited as Project Trainee-Content Writing from Date to Date.";

I want to extract the company name, role (designation), and Date (From-to)

I'm new to regex so please correct me if I'm wrong

the first thing I tried to extract each one of them separately

String regexStr5="Worked in:? \\w+" ;
String regexStr6 ="as:? ([a-zA-Z ]+)";  

and for the date Date : (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{1,2}, \d{4}

How can I put them all together in the same regex?!! and print the company-Name +role+date

7
  • Is the test string structured like that in all resumes ? Commented Mar 29, 2016 at 20:01
  • No absolutely not but this is a sample that I took from one resume Commented Mar 29, 2016 at 20:03
  • 1
    Then it's tough to match pattern. Regex is context free which means it doesn't understand like we do. You have to feed pattern syntax to match those. You can match string like this demo. For which it has to be structured. Commented Mar 29, 2016 at 20:04
  • 1
    Well then does my demo regex works for your purpose ? Commented Mar 29, 2016 at 20:09
  • 1
    yes it's perfect thanx very much,, mm sorry for pothering you but could you write your answer to accept it :))) Commented Mar 29, 2016 at 20:24

1 Answer 1

4

A literal string match would be just fine for above test string.

Regex: Worked in (.*) as (.*) from (.*) to (.*).

Replacement to do: Company Name: \1\nRole (designation): \2\nDate: \3 to \4

Regex101 Demo

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.