regex - Regular expression to align text -


i'm new here. seeking following done regex.

i have mc tests lines this:

q1  i.......go see doctor last week because ill.   (a) must (b) must    (c) had (d) should q2  could.......bought car didn't have enough money pay petrol.  (a) had (b) have    (c) have (d) can 

i line horizontal vertical. that's it. should this.

q1  i.......go see doctor last week because ill.   (a) must (b) must (c) had (d) should  q2  could.......bought car didn't have enough money pay petrol.  (a) had (b) have (c) have (d) can 

i can't seem make work. save me long long hours of work. appreciated.

find:

(\([b-d]\)) 

* this a-d answers, change d maximum possible answer

replace with:

\r\n$1 

input:

q1  i.......go see doctor last week because ill.   (a) must (b) must    (c) had (d) should q2  could.......bought car didn't have enough money pay petrol.  (a) had (b) have    (c) have (d) can 

output:

q1  i.......go see doctor last week because ill.   (a) must  (b) must     (c) had  (d) should q2  could.......bought car didn't have enough money pay petrol.  (a) had  (b) have     (c) have  (d) can 

is enough?

if want separate questions newlines, can search for: ^q(?!1\b)(\d*)\b , replace \r\nq$1. insert newline before questions except #1


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -