Thread: Vim regular expression weirdness
hello,
i'm trying write regular expression numbers/bitstreams, used in syntax highlighting file.
numbers \d+, bitstreams can start 0x hexadecimal bitstreams, or start 0b binary bitstreams.
both bitstream types can include x (or x) character 'dont care', , hexadecimal bitstream can include binary digits surrounded [ , ] specific binary digits inside hexadecimal number.
example, valid bitstreams are:
now, regular expression wrote number/bitstream token (it's case-insensitive):code:0x5467fb 0x78x5x1 0bx10x00 0x123[01] 0xff[1xx0] 0xf[1xx0]a
the weird thing is, doesn't match should match.code:\<\(\d\+\|0x\([0-9a-f_x]\|\[[01_x]\+\]\)\+\|0b[01_x]\+\)\>
example, 0xff[1x0] doesn't match, if add a 0xff[1x0]a, match.
reason this, , how can fix regular expression?
lot,
daniel
edit: well, problem seems \< , \>. brackets count word-boundary characters, expression terminates @ them. removing \< , \> solves problem, might introduce problem of highlighting parts of things win32 or web2.0x11 numbers. oh, well.
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] Vim regular expression weirdness
Ubuntu
Comments
Post a Comment