- Edited
ok i am playing around with python lately and am trying to write a code sample that take a text as an input and extract from it the 7 characters that proceed a certain string,
for example:
if text = aaaabbbb1234567XXXX
and the string to check is XXXX then the result will be "1234567"
with java i would simply do: System.out.println(text.substring(text.indexOf("XXXX")-7,text.indexOf("XXXX")));
how can i do it in python with regex or without? plus any one have a good tut for regex it will be very useful.
Thank You.
for example:
if text = aaaabbbb1234567XXXX
and the string to check is XXXX then the result will be "1234567"
with java i would simply do: System.out.println(text.substring(text.indexOf("XXXX")-7,text.indexOf("XXXX")));
how can i do it in python with regex or without? plus any one have a good tut for regex it will be very useful.
Thank You.