Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyterlab regular expression search

When using search/replace tool in jupyterlab there is a message into the search bar saying "Use /re/ syntax for regexp search"

However I could not find an example on how exactly this syntax should be. I tried few options but none really worked.

Can anyone give me an example of how this syntax should be?

like image 446
Eduardo Hulse Avatar asked Oct 26 '25 11:10

Eduardo Hulse


2 Answers

In Jupiter lab you can use the shortcut Ctrl+Shift+r to replace a word.

Once you do that you will see a white space when you can type your sequence if you want to use regexp you should write the sequence between slash.

For example, to replace line break by a comma you can type

/\n/

and you type Enter you see another blank space where you can write:

like image 162
abdellah el atouani Avatar answered Oct 29 '25 01:10

abdellah el atouani


Apparently in order to search for a regular expression in jupyterlab one should enter the regex syntax between two slashes '/'.

For example to search for all sequences of the letter A one should enter in the search bar: /A+/

like image 36
Eduardo Hulse Avatar answered Oct 29 '25 00:10

Eduardo Hulse