Sublime Forum

Regex - select the entire row that has .jpg extension

#1

hello. I had this line:

<strong> 15052009497.jpg &nbsp;&nbsp;<strong>205.91K

I need a regex to select all characters before and after .jpg from that row. Or, select the entire row that has .jpg extension

Can anyone help me?

0 Likes

#2

^.*\.jpg.*$

0 Likes

#3

thanks a lot

0 Likes

#4

but if I want so select instead of .jpg an expression like (class + 87 = &tag> -A1) , how can I do the ragex?

I try

^.*(class + 87 = &tag> -A1).*$

but it is not working

0 Likes

#5

It’s not working because +, ( and ) have special meanings in regular expressions. You have to escape them:

^.*\(class \+ 87 = &tag> -A1\).*$

I suggest reading up on Ruby-style regular expressions.

0 Likes

#6

can You give me a good link to Ruby-style regular expressions ?

0 Likes

#7

This is the one I use

https://manual.macromates.com/en/regular_expressions

0 Likes