Question: I am looking to create multiple font characters in emacs, but I am having trouble getting a regular expression that matches what I need. Here is what I have:
"\\<\\([0-9]*\\.?[0-9]*\\)+\\(d\\|f\\)?\\>"
I want it to match:
- 2
- 2.1
- 2.1f or 2.1d
- .1f or .1d
That I do not want it to fit
Current issues:
Currently it works mostly, but it does not match numbers like .2 or .2f because it does not match (.) Before numbers. It also currently matches a single “f” or “d” anywhere in the code, so the variable names match f or d. What am I missing here? I played with this every lunch break last week or so, I'm at a standstill.
source share