Home > Software engineering >  Ask how to write a regular expression
Ask how to write a regular expression

Time:02-18

I want a can match the inside of the parentheses (), the expression of the variable name, don't know how to write?

I know matching parentheses formula is [\ [(] [^ \]] + [\))]

Match the variable name is [a zA - Z] \ \ w *

A formula such as "if (x==2), how to match the x?

CodePudding user response:

\ [[^ a - zA - Z_] *? ([a zA - Z_] [a - zA - Z_0-9] *?)

CodePudding user response:

reference 1/f, zhao teacher reply:
\ [[^ a - zA - Z_] *? ([a zA - Z_] [a - zA - Z_0-9] *?)


The test is not successful
  • Related