Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#4 Regex with $ (end of line metacharacter) doesn't work

closed-accepted
None
5
2004-08-13
2003-05-21
Eric Fung
No

I'm using ctags-5.5 and its custom regex support to try
and find labels in assembly files. The source (e.g.,
blah.s) looks something like this:

label1
ADD r0, r0, 3

label 2
SUB r0, r0, 1

The command line is
ctags -x
--regex-asm='/^([A-Za-z_][A-Za-z0-9_]*)$/\1/l,label/'
blah.s

However, ctags doesn't return anything on the above
file. If I modify the above regular expression by
omitting the $, it finds the two labels.

Is this a bug, or a mistake in my regex?

Discussion

  • Darren Hiebert
    Darren Hiebert
    2003-06-11

    • assigned_to: nobody --> dhiebert
     
  • Darren Hiebert
    Darren Hiebert
    2003-06-24

    • status: open --> closed-invalid
     
  • Darren Hiebert
    Darren Hiebert
    2003-06-24

    Logged In: YES
    user_id=38016

    This is because your pattern does not allow for spaces. Your
    second label contains a space between "label" and "2", thus
    the pattern with a '$' in it does not qualify because the
    pattern before the '$' does not match the entire line.
    Either remove the space from the label name or change your
    pattern to take it into account..

     
  • Darren Hiebert
    Darren Hiebert
    2003-06-24

    • assigned_to: dhiebert --> nobody
    • status: closed-invalid --> open-accepted
     
  • Darren Hiebert
    Darren Hiebert
    2004-08-13

    • assigned_to: nobody --> dhiebert
    • status: open-accepted --> closed-accepted