Skip to main content

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:
code:
0x5467fb  0x78x5x1  0bx10x00  0x123[01]  0xff[1xx0]  0xf[1xx0]a
now, regular expression wrote number/bitstream token (it's case-insensitive):
code:
\<\(\d\+\|0x\([0-9a-f_x]\|\[[01_x]\+\]\)\+\|0b[01_x]\+\)\>
the weird thing is, doesn't match should match.
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

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62