Sublime Forum

Problem with regular expression and hash

#1

Hi all :smile:

I met a problem with the search with regular expressions (ST3).

Regular expression :

(?<=\b=')^']*

String :

<a id='myId' href='#' class='btn'> 

hash (#) is not found while it is on Rubular.

I forgot something or it is a problem with st3 ?

Thx

Kevin

ps: sorry for my english :cry:

0 Likes

#2

Your regex is invalid.

(? is not an valid group structure

regex101.com/

0 Likes

#3

?<= is correct syntax for a positive lookbehind.

The regex (?<=\b=’)^’]* basically says, using a positive lookbehind to ensure the following matches are preceded by a word boundary, an equals sign, and a single quote, match until encountering a single quote.

Your regex works on your example text just find in my ST3.

0 Likes