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
Post a Comment