javascript - Regex - replace end of line, not string? -


i building foxpro c# conversion , replacing common foxpro syntax work in c#.

'if' becomes 'if ('   'else' becomes '} else {'  'endif' becomes '}' 

now need able identify end of line on if statement can close ) {. how can accomplish via regex/jquery?

jsfiddle

here regular expression work

/^if([^$\n\r]+)(?:$|\r\n)/gim

check fiddle


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -