Could you tell me the Ruby regular expression pattern that corresponds to the following Python one.
re.compile(b"\x02\xff\xfe(.*?)\x03\xff\xfe")
This can be used to identify UTF8 characters with BOM (byte order mark).
Could you tell me the Ruby regular expression pattern that corresponds to the following Python one.
re.compile(b"\x02\xff\xfe(.*?)\x03\xff\xfe")
This can be used to identify UTF8 characters with BOM (byte order mark).
This yields true:
s = "\u0002\u00ff\u00fe123\u0003\u00ff\u00fe"
p /\u0002\u00ff\u00fe(.*?)\u0003\u00ff\u00fe/.match?(s)
See Ruby proof.
Use \uXXXX notation.